How to remove https://api.w.org/

Best WordPress theme for game news websites, game portals or whatever your preferred subject.
GK User
Tue Aug 15, 2017 12:16 pm
Hi Josh,

W3C is giving me some errors such as:

Bad value https://api.w.org/ for attribute rel on element link: The string https://api.w.org/ is not a registered keyword.

I have tried adding the below code to the functions.php but it has no effect am i missing something?

remove_action( ‘wp_head’, ‘rest_output_link_wp_head’ );
User avatar
Senior Boarder

Joshua M
Wed Aug 16, 2017 8:01 am
User avatar
Moderator

GK User
Wed Aug 16, 2017 4:46 pm
Just tried that too and it has no effect. Just to make sure this should go in the main functions.php am i correct?
User avatar
Senior Boarder

GK User
Wed Aug 16, 2017 4:56 pm
Sorry for double post but i have fixed the issue and will share for anyone else wanting to fix this.

Add the below lines of code to your themes main functions.php file:

Code: Select all
remove_action('template_redirect', 'rest_output_link_header', 11, 0);
remove_action('wp_head', 'rest_output_link_wp_head', 10);


For discovery links add this one:
Code: Select all
remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
User avatar
Senior Boarder

Joshua M
Thu Aug 17, 2017 7:45 am
Thanks for your solution, I'm sure it will be helpful for other users.
User avatar
Moderator


cron