• Resolved packaginghub

    (@petercole)


    We are facing issue with our Yoast sitemap. After adding canonical tags (that is different), Yoast is not showing any post link in “post-sitemap.xml“.

    Please suggest any solution for it. We uninstalled Yoast and re-installed it but this method didn’t work.

    Note: In default blog URLs we have date, but we are redirecting (301) it without date URL and also adding canonical tag of of non-date URL.

    We can’t change the default Slug formatting, as if we do it then it will change our products pages as well.

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

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

    (@maybellyne)

    Hello @petercole

    Thanks for reaching regarding your sitemap. Can you share examples of URLs you have redirected and have the ones you have set a different canonical URL?

    Thread Starter packaginghub

    (@petercole)

    Hi @maybellyne
    When we publish any post, by default it makes slug with date like this
    https://packaginghub.com/blog/2023/07/cornstarch-packaging/

    but we want to show and index this url without date.
    https://packaginghub.com/blog/cornstarch-packaging/

    When we add canonical url (https://packaginghub.com/blog/cornstarch-packaging/), it removes post link from post sitemap “post-sitemap.xml“.
    As you can see in our sitemap, there is not blog post URL in sitemap.

    We also added redirecting (301) response code from date to non-date URL.
    from
    https://packaginghub.com/blog/2023/07/cornstarch-packaging/
    to
    https://packaginghub.com/blog/cornstarch-packaging/
    for some pages.

    We found when we add different canonical url, it removes post link from sitemap.

    Please let us know where we are making mistake or what we should do to resolve this issue.

    • This reply was modified 2 years, 8 months ago by packaginghub.
    Plugin Support Maybellyne

    (@maybellyne)

    Thanks for the helpful examples. Instead of the redirects, did you consider the permalink settings? You could have changed from a
    Day and name permalink structure to Post name. With this, WordPress takes care of the redirects; you don’t need a plugin.

    About the empty post sitemap, the issue isn’t with the canonical URLs but first, the redirects. Since you have redirected the URLs, they will be excluded from the Yoast SEO-generated sitemap.

    You can test this out with one of your URLs. Remove the redirect and let the post URL default to slug with a date. That URL will be included in the post-sitemap.

    Next, change the canonical URL to the one without the date, the URL with the date will no longer show in the sitemap but the one without a date (the canonical URL) will be included in the sitemap instead.

    Do let me know how it goes.

    • This reply was modified 2 years, 8 months ago by Maybellyne.
    Thread Starter packaginghub

    (@petercole)

    We can’t change it, like Day and name permalink structure to Post name as I have already mention the reason in first post.

    I checked it by removing the redirection but it didn’t make any changes. But when I removed canonical tag then found it post sitemap with date.
    https://i.imgur.com/O6RU1Ww.png

    It looks it is related with canonical. Don’t know there is any setting or other issue. Please suggest anything else.
    Thank you

    Meanwhile I will also try it with new blog post.

    Plugin Support Maybellyne

    (@maybellyne)

    What I meant was for you to test what I explained so you’d understand it better.

    Currently, /2023/07/cornstarch-packaging/ no longer redirects to /blog/cornstarch-packaging/. Regarding the sitemap, the URL used as the canonical URL will show in the sitemap and not the page URL.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Yoast Sitemap Not Showing Blog Posts’ is closed to new replies.