• Resolved vijaykrpp

    (@vijaykrpp)


    I am having REST API error only and only after installing toast SEO. Even after using the default theme with no other plugin (except yoast), this error is coming in the health screen:
    The REST API encountered an unexpected result.
    Here is the messages when I enabled the debugging mode: https://imgur.com/a/m9QoT6l

    I tried to fix it using dev mode but nothing happened.

    I am using:
    WordPress 5.8.3
    PHP 8.0 (tried with 7.4, same error)
    Plugins: No plugins except yoast
    Server architecture: Linux 3.10.0-962.3.2.lve1.5.52.el7.x86_64 x86_64
    Web server: LiteSpeed

Viewing 9 replies - 1 through 9 (of 9 total)
  • @vijaykrpp

    Yoast SEO requires REST API enabled to work as you can read here. Could you please check if REST API is enabled on your server?

    Thread Starter vijaykrpp

    (@vijaykrpp)

    Hi Suwash, I did a few things on this REST API thing I have 2 WP blogs and tried to understand the difference between b/w them. (the first blog is working absolutely fine).

    1. Accessing site.com/wp-json:
    site 1: returns the site content in JSON
    site 2: critical error in the site, no results.

    2. I installed a plugin WP REST API Controller in both. I found that site 1 has the meta key for toast such as posts, pages, tags, etc (link).

    However, I did not find anything on site 2 under “categories”. (link)

    3. I am using web story plugin in both. And, the REST API is working for that on both sites with no issues. So this is clear that this issue starts only when I use Yoast. If the REST API were completely disabled on my site, other plugins could not be using it.

    I tried many other things like install/uninstall, fresh WP install, .htacess reset, etc, but no luck.

    Thread Starter vijaykrpp

    (@vijaykrpp)

    UPDATE:
    I have found one interesting thing:

    The error lies only for Yoast v16.0 or after. If I rollback to Yoast 15.9 or lower, it does not show any API error & /wp-json/ returns expected.

    @vijaykrpp

    To confirm further, can you please try resetting our indexables in the database tables by following the steps below?

    1. Install & activate the Yoast Test Helper plugin
    2. Go to Tools > Yoast Test
    3. Locate the Yoast SEO section and click on the ‘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.

    Note: Resetting the optimization doesn’t undo any of the hard work you’ve put into the plugin as the SEO data is also stored in WordPress’ default tables. It’ll just reset the custom Yoast tables that contain the combined data pulled from those default tables.

    4. Go to SEO > Tools, and under SEO data, click the “Start SEO data optimization” button to allow Yoast to rescan your content.

    Does the issue resolve?

    Have you performed the conflict check by disabling non-Yoast plugins and switching to the standard TwentTweny theme, just in case?

    Thread Starter vijaykrpp

    (@vijaykrpp)

    Hi, Finally I was able to fix it. Few DB tables got corrupted somehow and were the reason behind it. I backed up the entire DB, deleted everything and re-installed the WP. renamed the tables one by one and wp_options & wp_terms/taxonomy were the real culprits. Fresh install over-written them & it’s all set now.

    /wp-json/ now returning JSON response as it should.

    Plugin Support Michael Tiña

    (@mikes41720)

    Hi,

    We’re glad to hear that you were able to resolve the issue!

    We’ll be closing this forum thread to keep the overview. Thanks!

    I am having the same issue. Is there a chance that an upcoming update might fix the issue?

    Thread Starter vijaykrpp

    (@vijaykrpp)

    check if yoast is causing the issue. Uninstall it and revisit the health status page.

    After deactivating all plugins and reactivating one-by-one it turned out that Yoast caused the issue. But anyway: after installing another plugin update (there were two!! yesterday) to the latest version 18.4.1 the issue is solved.

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

The topic ‘Yoast Rest API Error’ is closed to new replies.