Sitemap Issues

#636102
  • Resolved Rajnish K. Thakur
    Rank Math free

    Site: appsfront.co

    I am facing much difficulty in setting my author sitemap. Kindly help.

    See I have several authors here. But in sitemap, you can check there’s only one.
    Sitemap issue

    Sitemap

    [moved to sensitive data section]

    Please help

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

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    In this case, please follow the steps below for troubleshooting (if not yet):

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

    2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. 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/

    If the issue still persists, then try disabling the transient cache for the sitemap. This will make sure that your XML sitemap always reflects the latest changes on your site:

    /** 
     * Filter if XML sitemap transient cache is enabled.
     *
     * @param boolean $unsigned Enable cache or not, defaults to true
     */
    add_filter( 'rank_math/sitemap/enable_caching', '__return_false');

    If you’re not sure how to add this code, you can follow this guide:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Let us know how this goes.

    Thank you.

    Tried everything. None helped.

    Hello,

    In this case, please try to follow this guideline for further troubleshooting: https://rankmath.com/kb/url-not-in-sitemap/

    If the issue still persists, then 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/

    Looking forward to helping you.

    Thank you.

    I have shared

    Hello,

    Our plugin only adds the authors that have at least one published post or page. But when we checked your website we found that except for Apps Front Team, no other users have any post or page and that’s why they are not getting included in the sitemap.

    Regarding your /providers-category-sitemap.xml, /sf-amenities-sitemap.xml and /sf-cities-sitemap.xml, we’ve added the following filter on your theme’s functions.php file to include them on your main /sitemap_index.xml and now they are appearing there:

    add_filter( 'rank_math/sitemap/index', function( $xml ) {
    	$xml .= '
    		<sitemap>
    			<loc>https://appsfront.co/sf-amenities-sitemap.xml</loc>
    			<lastmod>2020-09-14T20:34:15+00:00</lastmod>
    		</sitemap>
    		<sitemap>
    			<loc>https://appsfront.co/sf-cities-sitemap.xml</loc>
    			<lastmod>2020-09-14T20:34:15+00:00</lastmod>
    		</sitemap>
    		<sitemap>
    			<loc>https://appsfront.co/providers-category-sitemap.xml</loc>
    			<lastmod>2020-09-14T20:34:15+00:00</lastmod>
    		</sitemap>';
    		return $xml;
    }, 11 );
    

    If you don’t want this filter on your theme’s functions.php file, then you can use any of the methods mentioned in this guideline to add this filter on your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/

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

    Thank you.

    Please include all the author’s profiles whether they have posted anything or not. The reason is those authors here represent our forte. That’s why it’s essential.

    Thanks for the above solution.

    Hello,

    In this case, you can use the following filter on your website to add extra URLs to your author sitemap:

    add_action( 'rank_math/sitemap/author_content', function() {
    return '<url>
    <loc>https://rankmath.com/some-custom-url/</loc>
    <lastmod>2020-06-10T20:20:20+00:00</lastmod>
    </url>';
    });
    

    For multiple URLs, you can modify the code like the following one:

    add_action( 'rank_math/sitemap/author_content', function() {
    return '<url>
      <loc>https://rankmath.com/custom-url-1/</loc>
      <lastmod>2020-06-10T20:20:20+00:00</lastmod>
    </url>
    <url>
      <loc>https://rankmath.com/custom-url-2/</loc>
      <lastmod>2020-06-10T20:20:20+00:00</lastmod>
    </url>
    <url>
      <loc>https://rankmath.com/custom-ur-3/</loc>
      <lastmod>2020-06-10T20:20:20+00:00</lastmod>
    </url>';
    });
    

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

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

    We will not be able to add every author’s name manually. There will be 10000’s of author’s profile.

    Right now we have 22 authors (we used url: /company/ ) for authors. Please make them all appear in our author sitemap. This is one of the major issue. Please do such that whenever any author gets added it will reflect in our sitemap.

    Hello,

    Thank you for your patience.

    To be included in the sitemap, the author must have at least one published post. If there are no posts for an author’s archive, then it will not be included in the sitemap

    However, to remedy that, I have applied this filter on your theme’s functions.php file to include them even if they don’t have any posts yet:

    add_filter( 'rank_math/sitemap/author/query', function( $args ) {
        $args['has_published_posts'] = null;
        return $args;
    } );

    You can now see the updated author sitemap including all of them.

    Also, please note that the filter applied might get overwritten when your theme updates. You can use the alternative methods in our guide here to apply the filter to avoid that:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Sitemap Issues’ is closed to new replies.