Testing The Default WordPress Sitemap

Using Firefox to read the default WordPress sitemap.xml is not working well for me. For some reason, Firefox keeps waiting for the end of the file, but it never comes.

“Transferring data from ferodynamics.com…” and the loading icon keeps going forever.

I’m wondering if this a bug in WordPress that nobody noticed, because typically PHP will exit after a certain (short) period of time. However, because my stack is configured for larger files (like videos) I don’t have PHP configured to timeout and die after a few seconds. Could this be fixed with a custom Nginx setting? Maybe.

Regardless, the sitemap does download in Firefox, you just can’t see anything unless you press F12 and look at the Network tab.

I decided to use wget (from a Linux terminal) and that works fine, which makes me feel better, because most robots will be using something like wget, not Firefox.

Did I find my latest blog post in the sitemap? The answer is no. This seems like a bug. Or some kind of caching delay.

wp-sitemap-posts-page-1.xml seems to work fine. But where are the posts?

Next I tried view-source:https://ferodynamics.com/wp-sitemap-posts-post-1.xml in Firefox and that showed my first post from last week, but not my new post. Hey, we are making progress! I reloaded the URL again and like magic my new post appeared in the xml.

I don’t know all of the details, but it sounds like Google contributed some or all of this code. I think it’s safe to say Google knows more about sitemaps than Yoast. In the past, I would never recommend using a (backend) sitemap from Yoast, or anyone else. But since WordPress added this functionality with help from Google, I’m going to change that recommendation.

After a lot of investigation, I’m finally convinced the default WordPress sitemap (added in WordPres 5.5) works correctly, and according to my conversation with Pascal Birchler, this code was already tested to work with large blogs. Hence the number at the end of these .xml files.

The main advantage here, in my opinion, is you get to show off your taxonomy (categories and tags.) Whereas without a sitemap, maybe you were trusting your theme to reveal that information to search engines, and some themes don’t show the current category, or tags.

Does the default WordPress sitemap validate? Yes and no. I tried two validators. One failed, one did not. Also I’m confused about the “xsl:variable” code in the wp-sitemap-index.xsl. What is that all about? But it doesn’t seem like a big deal, I will look into that another time.

Leave a Reply

Your email address will not be published. Required fields are marked *