• Resolved CNG SEO UK

    (@cng-seo-uk)


    Error Line 85, Column 367: Bad value category tag for attribute rel on element a: The string category is not a registered keyword or absolute URL.

    …s in Uncategorized” rel=”category tag”>Uncategorized</span><span class=”au…

    I understand this but I can not find it lol…..

    I keep getting W3C errors with this…

    Please advise

    Should it not be category_tag?

    Using 3.61 beta

Viewing 5 replies - 1 through 5 (of 5 total)
  • The W3C is no longer up to date and these errors should be ignored.
    If you try and validate other WordPress, you’ll find the same thing.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    The rel="category tag" is part of the rel-category microformat specification:
    https://microformats.org/wiki/rel-category

    Note that the W3C validator tools are meant as guides, not to be taken as absolute truths. Their checks may not be up to date with the current standards that are in widespread use.

    Should it not be category_tag?

    While this statement is highly debatable, some will argue that the “correct” (and I use the term very loosely) rel attribute should be tag. I’m not going to debate the validity of HTML validation but if you prefer you can use this filter I wrote that addresses the “issue”

    /**
      * Filters the_category() to output html 5 valid rel tag
      *
      * @param string $text
      * @return string
      */
    function html_validate( $text ) {
    	$string = 'rel="tag"';
    	$replace = 'rel="category tag"';
    	$text = str_replace( $replace, $string, $text );
    
    	return $text;
    }
    add_filter( 'the_category', 'html_validate' );
    Thread Starter CNG SEO UK

    (@cng-seo-uk)

    ahh many thanks

    Thread Starter CNG SEO UK

    (@cng-seo-uk)

    Ok have put this filter in and it works great thanks…….

    Thanks for your help I am obliged.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Rel = Category Tag’ is closed to new replies.