1

when I made my wordpress site validate I got some strange errors like

Error Line 6, Column 52: Bad value profile for attribute rel on element link: Keyword profile is not registered.

Error Line 12, Column 128: Bad value EditURI for attribute rel on element link: Keyword edituri is not registered.

Line 14, Column 91: Bad value index for attribute rel on element link: Keyword index is not registered.

Line 89, Column 208: Bad value category for attribute rel on element a: Keyword category is not registered.

Line 111, Column 208: Bad value category for attribute rel on element a: Keyword category is not registered.

I searched over Google but not found any solutions. Can any one help me out?

3

It appears you are using an HTML 5 theme. The W3C doesn't validate all HTML output even though it might be "valid code". The errors you've sent are generated by WordPress and most can be removed fairly easy by de-registering the WordPress Hooks which are causing them. The hooks are used to achieve things like grouping galleries, categories, and other similar tasks. Some can be removed without a negative or noticeable result. If you're trying to be 100% W3C Valid, it might be best to stick with XHTML until HTML5 becomes more accepted/documented. I believe the time you'll spend to remove the errors out way the benefits of using HTML 5. I would either live with the errors or wait for the W3C to expand the rules. If you are set on using HTML5 and achieving 100% Validity, here are 2 informative links to help you out: WP-Engineer Article on "Cleaning up the WordPress Header" Articles describing the cause of the Keyword Validation Errors.

3

Some rel= attributes don't have valid markup, it's really not a big deal, for instance the word tag is HTML valid, but the word category is not.

If your loop uses the_category , or wp_list_categories ( I think), you can replace it with the following,

function add_nofollow_cat( $text ) {

    $valid_tag = 'rel="tag"';
    $text = str_replace('rel="category tag"', $valid_tag, $text); 
    return $text;
}
add_filter( 'the_category', 'add_nofollow_cat' );

There are additional filters for rel= validation errors such as remove_action( 'wp_head', 'index_rel_link' ); that you can use that are easier, and can be found in a quick search (related to wp_head).

ps. This removal is pretty useless outside wanting your html to validate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.