Remove REST API/JSON API from WordPress header.

Harish Kumar · · 5126 Views

WordPress uses the REST API since edition 4.4 of the CMS. It allows developers to interact with the WordPress back-end more quickly since this API is a standard way to connect. However, this also adds the following header to your Worpress website:

<link rel='' href='' />
<link rel="alternate" type="application/json+oembed" href="" />
<link rel="alternate" type="text/xml+oembed" href="" />

To remove this added header from the WordPress website, you need to add the following lines of code in the functions.php file within the WordPress theme’s directory.

remove_action( 'wp_head', 'rest_output_link_wp_head' );
remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );

To remove the rest_output_link_header

remove_action( 'template_redirect', 'rest_output_link_header', 11, 0 );


  1. wp_oembed_add_discovery_links

  2. rest_output_link_wp_head

  3. rest_output_link_header


Please login or create new account to add your comment.

You may also like:

What Are the Key Features Of WordPress Website Development in 2024?

In this dynamic world of web development, where trends keep changing every now and then, WordPress managed to withstand the test of time and stand resolute as a dominant website (...)
Vikrant Singh

How to Build Flutter App for any WordPress Site

Leaving a perfect digital footprint is crucial for brand growth. However, you may be here to find the optimal balance between mobile engagement and web traffic. It’s possible (...)
Narola Infotech

The Benefits of Using Hospital Management Software in 2024: A Guide for Healthcare Providers

In the ever-evolving healthcare landscape, integrating technology has become imperative for efficient and effective patient care. One such technological advancement that has revolutionized (...)

Types of Web Applications With Examples And Industry Use Cases

Whether it’s about driving more revenue for your business or strengthening your branding game, an impactful online presence is crucial. To make sure this is done right, there (...)
Narola Infotech

How Can I Find Best WordPress Development Company In India 2023?

According to me there are various companies who are doing WordPress development but some of them are providing reliable word press development solutions.
Kenny William

Use Transients API Caching and Speed Up Your WordPress Theme.

The Transients API in WordPress is an effective method for saving cached data in the database. It allows us to take resource-intensive queries and store them in short-term caches (...)
Harish Kumar