• Resolved jamiehalvorson

    (@jamiehalvorson)


    Hi,

    I’m experiencing a weird issue on one of my sites, the sitemap link in the robots.txt file changes. It goes from https:// to https:// and back again, sometimes as frequently as every 20-30 minutes.

    I was wondering if this is a known issue or if others experience it. Can’t quite figure out why the url would be updating itself.

    Cheers,

    Jamie

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi Jamie,

    The robots.txt file output is stored in object cache for 86400 seconds (24 hours). If your site is accessible on both HTTPS as HTTP, then this switch can be visible on both schemes.

    In the next update (2.8.0), you’re able to select your preferred scheme. I’d suggest to set that to HTTPS: not only to prevent duplicated content, but also for better ranking. Because HTTPS is preferred over HTTP in Google’s ranking.

    If you wish to grab a copy of 2.8.0, you can get an Dev version (use at own risk!!!) from GitHub.

    Alternatively, you could use the (untested) snippet below and place it in your theme’s functions.php file. Be sure to remove it when you update to 2.8.0 to prevent mistakes.
    The snippet will force the HTTPS scheme, on both the canonical URL, as within the sitemap, as in the robots.txt output:

    add_filter( 'the_seo_framework_canonical_force_scheme', 'my_seo_scheme_forcing', 10, 2 );
    function my_seo_scheme_forcing( $scheme = null, $current_scheme = 'http' ) {
    
    	if ( 'http' === $current_scheme )
    		return 'https';
    
    	return $scheme;
    }

    I hope this helps and clears things up. Cheers ??

    • This reply was modified 8 years, 2 months ago by Sybre Waaijer.
    • This reply was modified 8 years, 2 months ago by Sybre Waaijer. Reason: typo in code
    Plugin Author Sybre Waaijer

    (@cybr)

    Hi @jamiehalvorson,

    The canonical URL options are now in place with The SEO Framework 2.8.0.

    You’re free to remove the previous supplied filter, if you’ve implemented it.

    Enjoy! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sitemap link updates itself’ is closed to new replies.