Yoast / wordpress-seo

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

Title and Meta description not updating on version 23.0 #21459

Closed adouglasiVET closed 2 months ago

adouglasiVET commented 3 months ago

Please give us a description of what happened

Whenever we update title tags or meta descriptions in the Yoast settings for each page, they are not actually updating on the site, and don’t reflect the changes on the all pages preview. See screenshots below:

Yoast settings:

https://drive.google.com/file/d/1c7A53ZmF_JFVewEcJ-2xd-08HNYOkDIW/view?usp=sharing

All Pages preview:

https://drive.google.com/file/d/1FQAbJAB4GH8gx_5v2oKL7okq3P7eutqK/view?usp=sharing

Not reflected in source code:

https://drive.google.com/file/d/1SzHPm9oWz4m4QsbWx4_jRgULTOsNVPDZ/view?usp=sharing

Title should be updated to: Best Vet Near Me [Zip Code] – [Hospital Name] – [City/State]

We tested deactivating all plugins (other than Yoast) and activated the default theme (WordPress 2024) and the issue is still happening.

This issue is only happening on the new version of the plugin (v23.0), and it happens on every single staging site we have checked.

We have tried this method to fix (and it works), however, we can't do this every single time we need to create a new staging site from a live site:

We added this line:

define( ‘WP_ENVIRONMENT_TYPE’, ‘production’ );

installed and ran this plugin:

https://wordpress.org/plugins/yoast-test-helper/

clicked on the ‘Reset indexables tables & migrations’, ‘Reset Prominent words calculation’, and ‘Reset Internal link counter’ buttons.

Went to Yoast SEO > Tools and re-ran SEO data optimization and the issue appears to be fixed.

Why is this only happening on the new version of Yoast? Are we just going to have to do this for every staging site we use going forward, so that we can do SEO changes in staging before moving to production? This would be a huge hassle to do every time we want to update SEO on a staging environment ….

Something changed with the new plugin that doesn’t properly update the database. Prior versions do not have this issue.

To Reproduce

Step-by-step reproduction instructions

  1. Log into the site
  2. Try updating a title tag or meta description in the page/post editor.
  3. It does not update.

Expected results

  1. The title tag or meta description should be updated.

Actual results

  1. It does not update the title tag or meta description.

Screenshots, screen recording, code snippet

If possible, please provide a screenshot, a screen recording or a code snippet which demonstrates the bug.

https://drive.google.com/file/d/1sDdXIb5ozj76DrZFb4PTP2LjB3P4pNtQ/view

Technical info

Used versions

josevarghese commented 3 months ago

Hi @adouglasiVET

Thanks for using the Yoast SEO plugin and also for creating the issue.

In version 23.0, we fixed a bug that caused unnecessary data to be written in the Yoast indexable database on non-production sites (where the environment is not set as non-production) or when the Yoast\WP\SEO\should_index_indexables filter was used to disable the indexable. Please take a look at the PR here for your reference. This bug fix was to fully prevent the creation of indexable data on the staging site. Otherwise, when migrating the site from staging to live, the indexable must be reset manually, else the Yoast indexable database will contain the staging site URLs, and it may get outputted on the source code.

Regarding the issue you pointed out, we followed the steps you mentioned on the staging site and noticed that the values you added to the Yoast metabox are saved in the database. However, the overview screen outputs the recently created SEO title and meta description values on the column for all the posts. So we created a new issue for it here: https://github.com/Yoast/wordpress-seo/issues/21460.

We tried the other issue you pointed out, with the page source code not getting outputted with the SEO title and meta description you added to the metabox. Upon our lab sites, we noticed that the SEO title and meta description with the values added to the Yoast metabox are outputting correctly on the source code without any actions. So, to narrow down the issue further, can you please check whether you have added any filters for the indexable or set the environment as staging other than the WP_ENVIRONMENT_TYPE?

Also, please make sure to reset the indexable again on the staging site to check whether the issue continues with version 23.0. After resetting the indexable, can you please check the database to see whether the table yoast_indexable contains any values?

We look forward to hearing from you and are happy to help you.

adouglasiVET commented 2 months ago

I have not changed or added anything at all. We have not added any filters for the indexable, or set the environment as staging outside of the normal staging site process from our host Kinsta. There are these lines at the top of wp-config.php:

<?php /* BEGIN KINSTA DEVELOPMENT ENVIRONMENT - DO NOT MODIFY THIS CODE BLOCK */ ?>
<?php if ( !defined('KINSTA_DEV_ENV') ) { define('KINSTA_DEV_ENV', true); /* Kinsta development - don't remove this line */ } ?>
<?php if ( !defined('JETPACK_STAGING_MODE') ) { define('JETPACK_STAGING_MODE', true); /* Kinsta development - don't remove this li>
<?php /* END KINSTA DEVELOPMENT ENVIRONMENT - DO NOT MODIFY THIS CODE BLOCK */ ?>

I just want to be clear that we changed nothing, but this issue happens on ALL staging sites once updated to Yoast 23.0. This issue did not occur at all prior to version 23.0.

I would like clarification on this:

will we now need to go through ALL of our staging sites and add this line to wp-config.php:

define( ‘WP_ENVIRONMENT_TYPE’, ‘production’ );

Then follow this guide to reset indexables: https://yoast.com/help/how-to-reset-yoast-indexables/ to get the new version of Yoast to work properly in staging environments, correct?

What needs to be done when we are ready to push staging to live? I’m guessing we should first remove:

define( ‘WP_ENVIRONMENT_TYPE’, ‘production’ );

Its just a huge pain that we have to do a ridiculous workaround on hundreds of staging sites just to get this plugin to work as expected on non-production/staging environments. Boggles my mind that this is pushed back on the user to solve this issue.

josevarghese commented 2 months ago

Closing as our support team already responded to your forum topic with link to the issue we have created for it.