• flapane

    (@flapane)


    In the <head> section:
    <?php wp_get_archives('type=monthly&format=link'); ?>

    Leads to tons of:

    Bad value archives for attribute rel on element link: The string archives is not a registered keyword.
    <link rel=’archives’ title=’january 2015′ href=’https://127.0.0.1/foo/2015/01/&#8217; />

    How to fix it other than removing the function?
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    You can try using preg_replace rather than having to remove the function.

    Something like:

    add_filter( 'get_archives_link', 'my_filtered_links', 10, 1 );
    function my_filtered_links( $html ){
        $html = preg_replace( '|rel=\'archives\' |', '', $html );
        return $html;
    }
    Thread Starter flapane

    (@flapane)

    Thanks for your answer.
    I wonder if the issue should be handled by WP devs given that this is a WP function, and if such general <link> list without the deprecated ‘archives’ attribute could be still meaningful to search engines.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp_get_archives() fails w3c HTML5 validation’ is closed to new replies.