WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
sitemap autodiscovery & validation problems (20 posts)

  1. thomask
    Member
    Posted 2 years ago #

    1. it would be great, if you would update robots.txt with
    Sitemap: http://www.example.tld/sitemap_index.xml
    so autodiscovery would work - i know that you are informing google and yahoo, but there are many other search engines, that should have known about sitemap
    2. there is a problem with html validation with your plugin, as you are using RDF for social and for breacrumb. It occurs with HTML5 themes, what is today's default. It would be better to use microformats if possible.

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. thomask
    Member
    Posted 2 years ago #

    Just so you do not have to write to first point:

    add_filter ('robots_txt','mc_add_sitemap_index');
    function mc_add_sitemap_index($robots) {
    $robots .= "Sitemap: " .
    home_url( '/sitemap_index.xml' );
    return $robots;
    }
  3. thomask
    Member
    Posted 2 years ago #

    and solution for breacrumb:

    add_filter ('wpseo_breadcrumb_output','mc_microdata_breadcrumb');
    function mc_microdata_breadcrumb ($link_output) {
    $link_output = preg_replace(array('#<span xmlns:v="http://rdf.data-vocabulary.org/\#">#','#<span typeof="v:Breadcrumb"><a href="(.*?)" .*?'.'>(.*?)</a></span>#','#<span typeof="v:Breadcrumb">(.*?)</span>#','# property=".*?"#','#</span>$#'), array('','<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="$1" itemprop="url"><span itemprop="title">$2</span></a></span>','<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">$1</span></span>','',''), $link_output);
    
    return $link_output;
    }
  4. thomask
    Member
    Posted 2 years ago #

    and about the problem with social opengraph - you should add
    <html version="HTML+RDFa 1.0">
    so

    add_filter ('language_attributes','mc_language_attributes');
    function mc_language_attributes ($output) {
    $output .= ' version="HTML+RDFa 1.0"';
    return $output;
    }

    it will probably still not validate with W3C validator as this is still experimental function, but it is valid (e.g. http://dhuny.com/188)

    but it is questionable if this should be done, many people will probably dislike the another error notice in w3c validator

  5. HewattDesign
    Member
    Posted 2 years ago #

    Hey thomask, this is great that you've looked into this. Does the breadcrumb fix validate with the w3c validator?

    Also, where would you insert the breadcrumb filter code?
    Did you add it to a specific file from the plugin or your theme itself?

    Thanks in advance,
    - Andrew

  6. thomask
    Member
    Posted 2 years ago #

    yes, it will validate (see e.g. http://validator.w3.org/check?verbose=1&uri=http://www.money.cz/money-s3/vlastnosti-systemu/) and google recognise it as breadcrumb

    you can insert it functions.php or plugin, it is up to you. I yould not put it to theme files, as you would have to put it to every theme file

  7. HewattDesign
    Member
    Posted 2 years ago #

    Hmmm... it actually causes more errors than the 3 pre-existing ones (5 now). The issue is the itemtype, itemprop and itemscope not being recognized attributes. I haven't checked your facebook fix but the breadcrumbs update you listed maybe needs a little more tweaks.

    - Andrew

  8. thomask
    Member
    Posted 2 years ago #

    no, it is perfectly validate, as you can see on the validator link. Of course there may be other problems on your site - typicaly what is the html version of the page?? give here a link and i may look at it

  9. HewattDesign
    Member
    Posted 2 years ago #

    I've added your code in the class constructor function of wordpress-seo/frontend/class-breadcrumbs.php. Below is the link to the validation for the page. Let me know your thoughts.

    See the Results

    - Andrew

  10. thomask
    Member
    Posted 2 years ago #

    1. ehm. do not edit others plugins as it will make them not-updatable
    2. you are using XHTML 1.0 Transitional, actualy i do not know if it is possible to use microformats wíth xhtml and what you have to do for it. I am using HTML5, where it perfectly validates. Try to google the errors with xhtml 1.0 transitional, sorry for not helping more.

  11. HewattDesign
    Member
    Posted 2 years ago #

    Hey No worries thomask. Thanks for looking into it.
    Hopefully we can all find a solution to these little quirks.

    Take Care,
    - Andrew

  12. Rian Rietveld
    Member
    Posted 2 years ago #

    Thanks :)

  13. peterhadorn
    Member
    Posted 1 year ago #

    Wow, thanks a lot Thomas, breadcrumb validation now works like a breeze :)

  14. Turismo in
    Member
    Posted 1 year ago #

    So, how to validate with XHTML 1.0?

    A little months ago there isn't this problem with seo yoast breadcrumbs.

  15. jnpi
    Member
    Posted 1 year ago #

    A response for XHTML 1.0 validation problem would be appreciated. :)

  16. Turismo in
    Member
    Posted 1 year ago #

    Also breadcrumbs has XHTML 1.0 validation problem.

  17. djavin
    Member
    Posted 1 year ago #

    I just pasted these into my functions.php but it's not triggered.

    add_filter ('robots_txt','mc_add_sitemap_index');
    function mc_add_sitemap_index($robots) {
    $robots .= "Sitemap: " .
    home_url( '/sitemap_index.xml' );
    return $robots;
    }

    add_filter ('language_attributes','mc_language_attributes');
    function mc_language_attributes ($output) {
    $output .= ' version="HTML+RDFa 1.0"';
    return $output;
    }

    (I don't use the breadcrumbs in my theme)
    Could someone guide me and tell me exactly what to add? I think this code needs to be activated by some additional code? For all the noobs out there like me :) anyone?

    Thanks, great stuff ThomasK!

  18. redds013
    Member
    Posted 1 year ago #

    Thanks, That's sorted out my issue. Awesome

  19. kg69design
    Member
    Posted 1 year ago #

    Thanks to thomask - the solution about breadcrumbs works!

  20. Turismo in
    Member
    Posted 1 year ago #

    Breadcrumbs and social opengraph still XHTML 1.0 validation problem.
    Seo Yoast or anyone has solutions?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic