Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.77k stars 890 forks source link

Sitemaps not properly updated after installing SSL #6927

Closed brucebowman closed 7 years ago

brucebowman commented 7 years ago

What did you expect to happen?

When I added SSL to my site, I expected the Yoast SEO plugin to generate proper sitemaps using the new https:// urls.

What happened instead?

When I added SSL, my sitemaps was now found at https:///sitemap_index.xml, however, the contents of that file continued to include the http:// urls for the included sitemap files.

I tried disabling the XML sitemap functionality using the Enabled/Disabled radio button in the Yoast SEO - XML Sitemaps panel in the Yoast SEO WordPress plugin, but when re-enabling it, the problem still existed.

I finally got the sitemap_index.xml to update and use https:// urls by disabling the inclusion of Taxonomies sitemaps (in the Yoast SEO > SML Sitemaps > Taxonomies panel).

HOWEVER, now, even though I have re-enabled the Categories, Tags, and Format, those sitemaps are not being included in the sitemap_index.html

How can we reproduce this behavior?

Follow my process outlined above on a test site that has Yoast SEO installed and working for XML Sitemaps, but does not yet have SSL. Add SSL, and check the sitemaps to see if they're being regenerated properly.

Can you provide a link to a page which shows this issue? https://checkedintolife.com/sitemaps_index.xml

Technical info

brucebowman commented 7 years ago

I just discovered a workaround for this bug. In my case, I was able to jiggle the handle and get it to generate the correct sitemap_index.xml file by going to Yoast SEO > XML Sitemaps > Post Types, and enabling the Media (attachment) setting. Once I saved, and checked the sitemap_index.html, it had been regenerated to include not only /attachment-sitemap.xml, but also the sitemaps for category, post_tag, and post_format.

See screenshots of before and after

screenshot 2017-04-02 12 46 27 screenshot 2017-04-02 12 46 13
thulshof commented 7 years ago

Thanks for your report. We are not able to reproduce this issue. Does the issues occur again when you disable SSL and enable SSL again? Could you please check this? That would help us with finding the cause for this issue.

brucebowman commented 7 years ago

I am sorry the info I have provided is not enough to repro. I am not going to disable/reenable SSL on my site, and I don't currently have a staging site to test it on. Best of luck.

CarolineGeven commented 7 years ago

Closing as this cannot be reproduced.

rmarcano commented 7 years ago

To reproduce the issue: 1)On an HTTP site, go to Settings and change the WordPress Address (URL) and Site Address (URL) to HTTPS. 2)Check the sitemap file. All links still point to the HTTP version.

sitemap

The issue can also be reproduced by changing the settings from HTTPS to HTTP.

For me the workaround was making a new test post. But that only regenerated the links in post-sitemap.xml. Switching the sitemap functionality on and off did not work for me, but switching off one of the post types did.

Technical info WordPress version: 4.8 Yoast SEO version: 4.9

superherogeek commented 7 years ago

I solved this problem after going through the same madness. WPSEO leaves transient data in the wp_options table which contain cached versions of the sitemaps using 'http' instead of the new 'https'. You'll need to force the plugin to regenerate the XML by deleting this cached data.

Two Possible Ways to Fix

  1. You can download a plugin to manage transient data like Transients Manager (plugin page) and delete any entries with '_transient_wpseo' in the Name field.

2) If you're comfortable with SQL, just run this query while connected to your WordPress database: DELETE FROM wp_options WHERE option_name LIKE ('%_transient_wpseo%')

Developer Suggestion: Maybe update the plugin to delete the transient cached xml data when the XML Sitemaps are disabled.

MillerMedia commented 6 years ago

This is still an issue and I've isolated the problem even more. This may be an additional edge case or it may be what was affecting everyone here.

Clearing the transients did not work for. Neither did enabling and disabling options. My environment is a multisite and I had set the main URL originally to:

http://www.millermedia.io

I then updated the URL in the wp-config.php file with the constant variables WP_HOME and WP_SITEURL as explained here:

https://codex.wordpress.org/Changing_The_Site_URL#Edit_wp-config.php

The plugin was still drawing from the DB values, not from the constant values. In this case, those constant values should have taken precedence since that is default WordPress behavior.

krstikiv commented 6 years ago

I just switched my site from http to https, and had the same issue. I have WP Optimize to remove the expired transients. Here are my steps.

  1. Disabled XML functionality
  2. Clicked Save Changes
  3. Opened WP Optimize plugin
  4. Checked Remove expired transient options
  5. Selected Run optimiazation
  6. Return to Yoast, Enabled XML functionality > Save Changes

Then the xml sitemap worked.

junarmando commented 6 years ago

Put this to functions.php to disable sitemap caching add_filter('wpseo_enable_xml_sitemap_transient_caching', '__return_false');