Fix Yoast Error something has gone wrong and we couldn’t complete the optimization of your SEO data

After installing Yoast Pro and using the function Optimize SEO Data it may happen that you get the error “Oops, something has gone wrong and we couldn’t complete the optimization of your SEO data. Please click the button again to re-start the process.”

First, I want to assure you that not performing the optimization process will not affect your site negatively in search results. Additionally, the optimization process will run silently in the background as content on your site is created, modified, or removed. As the optimization process makes the Yoast plugin work more efficiently, let’s look into what might be causing this on your site. If you’d like to skip directly to the next steps, we have summarized our findings at the end of the article.

Yoast SEO - Fix Error Something has gone wrong in SEO optimization
Yoast SEO logo

We have seen this notice appear for sites where the previously optimized data is invalid or when there is a plugin or theme conflict. We’ll start with a reset of the optimization to make sure we’ve cleared out previously optimized data. You may be hesitant to reset data, but we can assure you that this does not undo any of the hard work you’ve done when it comes to the SEO of your content.

Reset Yoast Data

To reset the data, please follow these steps:

  • Install & activate the Yoast Test Helper plugin
  • Go to your WordPress admin dashboard > Tools (sidebar) > Yoast Test
  • Locate the Yoast SEO section and click on “Reset indexables tables & migrations”, “Reset Prominent words calculation”, and “Reset Internal link counter” buttons. After each click, the page will reload to confirm that each reset was successful.

Rerun Yoast SEO Data Optimization

Now that we have removed any previously stored data, we’ll need to rerun the data optimization. You have a few options to run the SEO data migration:

  • Inside the WordPress admin area: This is the method where you saw the above error.
  • Use the WP-CLI commands: This requires access to your server through a terminal service. Your web host may be able to help. If you have a large site, we highly recommend this method.

If the optimization completes successfully after the reset, you are ready to start using Yoast SEO and its features.

Debug JavaScript Errors

If the SEO data optimization doesn’t complete after the reset, we’ll need to gather information from your browser to determine the next steps. Please open your browser’s console and check for any JavaScript errors. If you’re not familiar with your browser console, we have a guide that will help:
How to find JavaScript errors with your browser’s console

There is a list of known error codes here(step 6) with recommended solutions. If the error is not listed or you have questions about the error, please provide Yoast with a screenshot of the error.

Summary of Findings

The most common causes are invalid previously stored data or a conflict with a plugin or theme on your site. The next steps are:

Related Articles