• Resolved Philipp

    (@philippmuenchen)


    Dear Ravan,

    first of all thank you very much for your work on this great Plugin. I really enjoy working with it especially in combination with Polylang.
    However in my setup I also use “The SEO Framework” plugin, which is a awesome as well and I would love to see both working together as with Polylang. But currently I have the issue that pages, which I set to “noindex” with SEO Framework are still in the sitemap. That throws some errors at Google Search Console.
    Do you have a hint for me how I can solve this or do you mind to have a look to this?

    Looking forward to your answer!

    Best regards,

    Philipp

Viewing 4 replies - 1 through 4 (of 4 total)
  • Dropping by…

    @philippmuenchen I don’t think you can easily solve this without adjusting the plugin’s code. If there aren’t many errors, you can ignore them for now.

    @ravanh, we use this code to determine noindex with The SEO Framework for posts:

    get_post_meta( $post_id, '_genesis_noindex', true );
    

    And for terms:

    $meta = get_term_meta( $term_id, THE_SEO_FRAMEWORK_TERM_OPTIONS, true );
    $noindex = $meta['noindex']; // '1', '0', null
    

    Cheers 🙂

    Thread Starter Philipp

    (@philippmuenchen)

    @cybr thanks vor your answer and the snippets. That was quite fast! 😉

    If there is a hook/filter I can use for the sitemap plugin, I would be able to check against the SEO settings and just output the sitemaps items if $noindex == '0'. That would be quite helpful. Especially I do not have to adjust the plugin code after updates.

    @ravanh I just found the ‘xmlsf_allowed_domain’ filter. Might this be the best start?

    Thank you both! It would be a great combination with your plugins.

    Best!

    • This reply was modified 8 years, 10 months ago by Philipp.

    @philippmuenchen Hi Phillip, are there many pages that you wish to exclude from the sitemap? If not, you can simply edit each page to find the XML Sitemap meta box (normally on the right side at the bottom) and check the “Exclude” option.

    But if there are many pages and/or you wish to automate this, you can use the filter “xmlsf_excluded” (the filter xmlsf_allowed_domain is for domains, not individual pages) which combined with Sybre’s helpful suggestion could look like this:

    
    function my_sitemap_page_filter_callback ( $excluded, $post_id ) {
      return get_post_meta( $post_id, '_genesis_noindex', true ) ? true : $excluded;
    }
    add_filter( 'xmlsf_excluded', 'my_sitemap_page_filter_callback', 10, 2 );
    

    @cybr thanks for dropping by! 🙂

    The SEO Framework support has been added to the todo list 🙂

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

The topic ‘The SEO Framework support’ is closed to new replies.