• Resolved jlapitan

    (@jlapitan)


    Hi,

    I’m currently looking for a snippet on how to exclude posts on the sitemap via post format filter.

    What I can only find is exclude posts by id, like the one below.

    /**
     * Excludes posts from XML sitemaps.
     *
     * @return array The IDs of posts to exclude.
     */
    function exclude_posts_from_xml_sitemaps() {
        return [ 1, 2, 3 ];
    }
    
    add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', 'exclude_posts_from_xml_sitemaps' );

    Is there an option or filters return all IDs by post format?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello Jlapitan,

    Thanks for reaching out regarding your sitemaps.

    We currently do not have a filter to exclude posts based on the post format. We only have filters for taxonomy term, author, taxonomy, post type and specific posts.

    But you or your developer can also extend the plugin based on your specific need.

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

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

The topic ‘Exclude post by format in sitemap’ is closed to new replies.