Title: Rest API header throws validation errors
Last modified: August 30, 2016

---

# Rest API header throws validation errors

 *  [James_tnf](https://wordpress.org/support/users/james_tnf/)
 * (@james_tnf)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/rest-api-header-throws-validation-errors/)
 * Hi there,
 * I’ve been working to tidy up my code based on the issues and warnings raised 
   by validation tools like W3C Html checker, and since I updated to 4.4 I’ve been
   getting errors based on the new WP Rest API header.
 * Error: Bad value [https://api.w.org/](https://api.w.org/) for attribute rel on
   element link: The string [https://api.w.org/](https://api.w.org/) is not a registered
   keyword.
 * Is this an oversight on the part of the developers, or have I just not set something
   up properly?
 * I don’t really want to leave errors in the code, if it can’t be fixed I’d rather
   just remove the API from the header.
 * Thanks,
 * James

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

 *  Thread Starter [James_tnf](https://wordpress.org/support/users/james_tnf/)
 * (@james_tnf)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/rest-api-header-throws-validation-errors/#post-6852223)
 * Just to add some extra detail, here’s how the link tag for the api is appearing
   in my site:
 * `<link rel='https://api.w.org/' href='http://www.commonwealthroundtable.co.uk/
   wp-json/' />`
 * Thanks
 *  [PabloMuir](https://wordpress.org/support/users/paulmuir/)
 * (@paulmuir)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/rest-api-header-throws-validation-errors/#post-6852278)
 * I’ve had the same problem since updating to 4.4 and it looks like it’s appearing
   for a bunch of other sites (according to a quick Google of the error).
 * Looks like something is either missing or needs to be deleted, but I’m not confident
   enough to do it myself 🙂
 *  Thread Starter [James_tnf](https://wordpress.org/support/users/james_tnf/)
 * (@james_tnf)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/rest-api-header-throws-validation-errors/#post-6852288)
 * Thanks for the comments Paul.
 * I also had a quick Google around the issue and found a few hacks, but no posts
   directly addressing that the issue was causing validation issues. :/
 * Would be nice if the WP development team could suggest a way to make this valid,
   or launch a bug fix release.
 *  [mimmo84](https://wordpress.org/support/users/mimmo84/)
 * (@mimmo84)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/rest-api-header-throws-validation-errors/#post-6852552)
 * I have the same problem too. I hope it will resolve soon.
 *  [yfell](https://wordpress.org/support/users/yfell/)
 * (@yfell)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/rest-api-header-throws-validation-errors/#post-6852568)
 * I also ran into this issue. I found another post about this here: [https://wordpress.org/support/topic/relhttpsapiworg-json-noise-doesnt-validate?replies=16](https://wordpress.org/support/topic/relhttpsapiworg-json-noise-doesnt-validate?replies=16).
   It doesn’t look like a fix will be happening soon, but at least it’s good to 
   know why it has appeared and why it’s breaking our W3C validation efforts.
 *  [dunxmax](https://wordpress.org/support/users/dunxmax/)
 * (@dunxmax)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/rest-api-header-throws-validation-errors/#post-6852569)
 * Hi,
 * I have also spotted this issue. I have been testing my site for load speed on
   Pingdom.
 * It appears that one of the reasons for the site loading being slowed down is 
   because it is looking for the “http://www.mydomain.com/wp-json/>; rel=“https://
   api.w.org/“ resource and because it can’t find it it is returning a 404 error,
   which is being shown as “/none” in Pingdom. The trouble is it’s taking 10 seconds
   or more to decide it can’t find the resource.
 * Nevertheless, I did some searching and found that if you add the following function
   to the function.php file it would stop your page looking for the resource:
 *     ```
       function remove_api () {
       remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
       remove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 );
       remove_action( 'template_redirect', 'rest_output_link_header', 11, 0 );
       }
       add_action( ‘after_setup_theme’, 'remove_api' );
       ```
   
 * So I added the code and it does indeed remove it from the header, and I alos 
   found that Pingdom no longer shows the link itself in the “/none” element, but
   it is still returning a 404 error, which subsequently is still slowing down the
   speed of the page loading.
 * To illustrate this I’ve created a graphic – I can’t see a way to share images
   here so I’ve posted an image on my website to illustrate what I’m seeing in the
   Pingdom speed tester.
    Here’s the link to the post:
 * [http://aquamandesign.co.uk/API-wordpress-problem.html](http://aquamandesign.co.uk/API-wordpress-problem.html)
 * My problem is I’m not a coder, so if anybody could enlighten us on how to fix
   this issue that would be really, really great.
 * Thanks
 * D

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

The topic ‘Rest API header throws validation errors’ is closed to new replies.

## Tags

 * [header](https://wordpress.org/support/topic-tag/header/)
 * [json](https://wordpress.org/support/topic-tag/json/)
 * [validation](https://wordpress.org/support/topic-tag/validation/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 5 participants
 * Last reply from: [dunxmax](https://wordpress.org/support/users/dunxmax/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/rest-api-header-throws-validation-errors/#post-6852569)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
