• Resolved Mon

    (@dusimone)


    Hi.

    The XML Sitemap generated by Yoast, shows 2 sitemaps, one for posts and the other for pages. While the latter works fine, what I am having trouble with is that the Post Sitemap when clicked displays this string, “This XML Sitemap contains 0 URLs”.

    I need to submit my sitemap to Google Search Console but it won’t discover my posts through this sitemap since this is showing none of the posts published on my site.

    Kindly help.

    The site I need help with is https://homeshed.co/

    The page I need help with: [log in to see the link]

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @dusimone

    Thanks for reaching out regarding your XML sitemap; I can also confirm the post sitemap is generated but contains no posts.

    The most common reason for an empty sitemap is no matched data. Do you have published posts on your site? If yes, can you share a couple of URLs?

    We look forward to hearing from you.

    Thread Starter Mon

    (@dusimone)

    Yes, I do have posts published on the site.

    Here are a couple of URLs:

    https://homeshed.co/best-lightweight-cookware-for-seniors/
    https://homeshed.co/cuisinart-fp2-24bk-frittata-saucepan-set/

    Some posts are even indexed by Google. Below contains the screenshot.

    Indexed pages

    Thanks for the response, @maybellyne

    • This reply was modified 1 year, 6 months ago by Mon.
    Plugin Support Maybellyne

    (@maybellyne)

    Thanks for sharing the URLs. Can you edit the posts and scroll down to the advanced tab of the Yoast SEO metabox? For the option Allow search engines to show this Post in search results?, choose ‘Yes’. Next, check the post sitemap to confirm if the post now shows

    Thread Starter Mon

    (@dusimone)

    Hi @maybellyne

    Checked all the posts and they are set to ‘Yes’ by default.

    Just to try though, I did manually set the option under Advanced tab to ‘Yes’ for a couple of posts and they still do not show.

    Hey @dusimone,

    Thank you for your reply and patience.

    I did have another look at your post sitemap and the page source. I saw some code from your W3 Total Cache plugin. So my belief is that your caching plugin is conflicting and caching our sitemaps, which you better exclude.

    Please have a look at our help article: https://yoast.com/help/exclude-sitemaps-from-cache/#w3tc

    After amending the W3TC settings, make sure to clear the cache and check if the post sitemap includes your posts.

    Thread Starter Mon

    (@dusimone)

    Hi @jeroenrotty,

    According to the article, I did go to the option ‘Do not process 404 errors for static objects with WordPress’ but it was not enabled.

    Regardless, I went ahead and added the regex code snippet to the 404 exception list, Never Minify exception list (although minification is done through Cloudflare, not W3TC) and the Page Cache exception list.

    I cleared cache from both the plugin and Cloudflare and checked again. The issue still persists.

    Kindly help.

    Thanks.

    • This reply was modified 1 year, 6 months ago by Mon.
    • This reply was modified 1 year, 6 months ago by Mon.
    Plugin Support Rohan Sadanandan

    (@rohans123)

    Hi @dusimone,

    As the next step, we’d like you to perform a conflict check. This will help you narrow down the exact cause.

    Often, we see problems occur in combination with another plugin or theme. The fastest way to rule out any conflict is to deactivate all non-Yoast plugins and switch to a standard theme like Twenty Twenty.

    Please test this on your development or staging site if you have one. If not, we recommend using the Health Check & Troubleshooting plugin. This plugin has a troubleshooting mode, which does not affect normal visitors to your site.

    If you’re unfamiliar with checking for conflicts, we’d like to point you to a step-by-step guide that will walk you through the process: How to check for plugin conflicts

    If you feel uncomfortable doing this yourself or if this does not solve your issue, our Yoast SEO Premium plugin comes with one year of (technical) support.

    Thread Starter Mon

    (@dusimone)

    Hi @rohans123

    I did perform the conflict check but there seems to be none.

    I also uninstalled the Cache plugin and checked. No improvement.
    Then I added a specific page rule to Cloudflare in order to bypass caching for the sitemap page at server level. That didn’t work either.

    Then I disabled the Sitemap feature from General->Features, flushed all cache, then enabled it again. After doing this, the sitemap doesn’t come up as empty anymore rather it redirects to a Page Not Found webpage. This is same for both post and page sitemap index.xml

    Not sure what to do about this.

    EDIT: I refreshed the permalink structure, flushed cache, then checked the sitemap again. Now it does not redirect to Page Not Found, but shows the same empty post sitemap from before.

    • This reply was modified 1 year, 6 months ago by Mon.
    Plugin Support Maybellyne

    (@maybellyne)

    Hello @dusimone

    I’m sorry the problem persists; the post sitemap is generated but empty.

    Can you confirm if you have a trailing slash for your URLs? For instance, https://homeshed.co/spooky-halloween-cookies-kitchen-accessories/ has a trailing slash while its canonical and og:url is missing that:

    <link rel="canonical" href="https://homeshed.co/spooky-halloween-cookies-kitchen-accessories" />
    <meta property="og:url" content="https://homeshed.co/spooky-halloween-cookies-kitchen-accessories" />

    Also, if you visit https://homeshed.co/spooky-halloween-cookies-kitchen-accessories (non-trailing slash version), it redirects to the trailing slash version, https://homeshed.co/spooky-halloween-cookies-kitchen-accessories which is a good thing, by the way.

    Please send a screenshot of what you have in WordPress > Settings > Permalinks. Do you have custom canonical URLs set for each post in the advanced tab of the Yoast SEO metabox when you edit the post?

    • This reply was modified 1 year, 6 months ago by Maybellyne. Reason: more questions
    Thread Starter Mon

    (@dusimone)

    Hi @maybellyne

    You’re right. I checked and I do have Permalink structure set as the trailing slash version. As that had been set a long time ago, I seem to have forgotten about it and yes, I do set the canonical URL for each post before I publish.

    The canonical URL I set manually is the non-trailing slash version. Is the mismatch causing the issue? If so, how do I fix it? Will it de-index my previous posts already indexed with Google?

    The requested Permalink settings screenshot : https://imgur.com/a/zWQhURZ
    Screenshot from Google Search Console (of some posts already indexed) : https://imgur.com/a/ivOLlgR

    Plugin Support Maybellyne

    (@maybellyne)

    Thanks, @dusimone, for the feedback.

    Indeed there’s a canonical mismatch. Yoast SEO plugin uses self-referencing canonical URLs. So if you leave the canonical field blank, the plugin will use the post URL as the default canonical; that’s the URL with the trailing slash.

    You’ll need to edit the posts to remove the custom canonical you have set. Once this is done, the post-sitemap should be populated

    • This reply was modified 1 year, 6 months ago by Maybellyne. Reason: hyperlink
    Thread Starter Mon

    (@dusimone)

    Hey @maybellyne

    I made the changes and the post sitemap now displays all my posts. Thank you for all your help.

    Just a quick question though, will Google be de-indexing my previous posts that had the canonical URL incorrectly set as the non-trailing slash version?

    Plugin Support Maybellyne

    (@maybellyne)

    Hello @dusimone, I’m glad we finally resolved this together. I believe with time, Google will re-index the correct URLs, that is, the trailing slash versions.

    Thread Starter Mon

    (@dusimone)

    Thank you for your response @maybellyne

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Error with Yoast’s Post Sitemap Index’ is closed to new replies.