Sitemap breaks due to permalinks

#1087374
  • Usman
    Rank Math free

    Hi, I have setup rankmath site map and my url permalink structere as follow:

    myweb.com/category/post-name/

    But due to this my sitemap url breaks and go to 404. When I changed it to http://www.myweb.com/post-name/
    than it works. Could you please advise. Site name in sensitive area.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    We apologize for the issue you are facing with your sitemap and permalinks. It seems that the permalink structure you are using may be causing conflicts with the sitemap generation in Rank Math.

    To resolve the 404 error with your sitemap when using the myweb.com/category/post-name/ structure, you can try flushing your permalinks. Here’s how to do it:

    1. Go to your WordPress admin area.
    2. Navigate to Settings → Permalinks.
    3. Without making any changes, click the Save Changes button.

    Flush Permalink Settings

    This action can often resolve issues related to sitemap generation and 404 errors. If the problem persists, please check for any plugin conflicts or consider reviewing your robots.txt file to ensure it’s not blocking access to your sitemap.

    If you need further assistance or a more comprehensive setup, we recommend our professional setup service, which ensures your plugin is configured correctly according to the latest SEO standards. You can find more information about this service at Rank Math Services.

    Thank you for raising this concern, and we hope this helps resolve your issue!

    Sources:
    Rank Math Sitemap Issues and Their Fixes » Rank Math

    This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.

    Hello,

    Thanks for contacting Rank Math support. We apologise for any inconvenience this might have caused you.

    Both myweb.com/post-sitemap.xml and myweb.com/category-sitemap.xml are opening correctly, and the URLs within these sitemaps are also opening correctly.

    In you are unable to access both sitemaps and the URL, it could be due to caching.

    In this case, please follow the steps below to see if that works for you.

    #1. Please update the plugin to the latest stable version.

    #2. Flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

    #3. Exclude the Sitemap files of the Rank Math plugin from caching. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    #4. If the above steps don’t seem to work, kindly apply the following filter code to your site.

    add_filter( 'rank_math/sitemap/enable_caching', '__return_false');
    

    Here’s how you can add filter/hook to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Once done, please clear your website cache and check the sitemap again.

    Let us know how it goes. We look forward to hearing from you.

    Thank you.

    Usman
    Rank Math free

    Hi Adetayo,

    Thanks for the detailed response.

    Actually I mentioned in my query that whenever I setup permalink structure with category, like as follow so the sitemap sitemap url breaks and go to 404.

    myweb.com/category/post-name/

    Currently, I have setup my permalink to myweb.com/post-name/ that’s why its working.

    But I want to set my urls as myweb.com/category/post-name/ – please guide.

    Thanks

    Hello,

    We are sorry for the confusion. Even if you change the permalink structure, the sitemap should work properly.

    In this case, after changing the permalink structure, could you please try clearing the sitemap cache by following the steps we mentioned above?

    If the issue persists, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Usman
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    1 more thing, to resolve this activity I changed permalink many time in different pattern and some of them linked from social media, some of them indexed and some of them used in internal linking.

    My final permalink structure as follow abc.com/category/post-name/

    Please take a look also, if any post linked to anywhere with permalink like abc.com/moth/date/post-name/ , abc.com/month/post-name/ OR abc.com/post-name/ THAT would be redirected to the original posts.

    Thank you and look forward.

    Usman
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    1 more thing, to resolve this activity I changed permalink many time in different pattern and some of them linked from social media, some of them indexed and some of them used in internal linking.

    My final permalink structure as follow abc.com/category/post-name/

    Please take a look also, if any post linked to anywhere with permalink like abc.com/moth/date/post-name/ , abc.com/month/post-name/ OR abc.com/post-name/ THAT would be redirected to the original posts.

    Further, I have make some rules under cloudflare which you can see here: https://imgur.com/a/Z3KSyuR

    Thank you and look forward.

    Hello,

    We can see your sitemap is working properly even with your new permalink structure.

    Regarding your old URLs, unfortunately, we do not offer personalized services like this. If you want, you can use our Redirection feature to redirect your URLs from the old structure to the new one: https://rankmath.com/kb/how-to-create-a-redirection/

    Hope that helps and please don’t hesitate to let us know if you have any other questions.
     
    Thank you.

    Usman
    Rank Math free

    Hi,

    Thanks Rakibuzzaman Siam for response.

    Actually 2-3 days back it was not working, so I again updated the permalink as response from your side is slow maybe becuause of the work=load.

    Now its working but still sitemap.xml is not working and sitemap_index stop working after every 2-3 days..

    let see what happened next.

    Hello,

    Sure, do let us know how that goes.

    It seems your sitemap may be heavily cached. If your site uses server-level caching or caching services, please ensure your sitemap is whitelisted. You may want to check with your hosting provider to confirm this.

    This should help keep your sitemap stable. Please let us know if the issue persists.

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

You must be logged in to reply to this ticket.