How to disable or enable the REST API endpoint in Yoast SEO

In Yoast SEO 14.0, we introduced a REST API endpoint that will give you all the necessary metadata for a specific URL. This makes it easier for headless WordPress sites to use Yoast SEO for their SEO meta output. In this article, we’ll explain how to disable or enable this feature in the Yoast SEO plugin.

Read more about the REST API head endpoint and what it is here:

How to disable or enable the REST API head endpoint

The REST API head endpoint feature is enabled by default. If you don’t want this API on your site, you can easily disable it by following the steps below.

  1. Log in to your WordPress website.

    When you’re logged in, you will be in your ‘Dashboard’.

  2. Click on ‘SEO’.

    On the left-hand side, you will see a menu. In that menu, click on ‘SEO’.

  3. Click on ‘Features’ in the General settings.

    On the Yoast SEO General settings page, go to the ‘Features’ tab. Features tab of the Yoast SEO General settings

  4. To disable the API, switch the toggle for ‘REST API: Head endpoint’ to ‘Off’.

    The toggle for this API is set to ‘On’ by default. To disable the REST API head endpoint, switch the toggle to ‘Off’.
    REST API Head endpoint toggle in Yoast SEO

  5. If you want to enable the API again, simply switch the toggle back to ‘On’.

    To enable to REST API head endpoint again, switch the toggle to ‘On’.

  6. Click ‘Save changes’.