• Resolved LNBridges

    (@usoblogger)


    We have a weekly ad, that for the client’s purposes, is created as a post and fed into a page. This is something the client is doing and a procedure I can’t convince them to change due to its ease of use for their staff.

    We are auto redirecting these links using a wildcard. Is there a way to create a rule to exclude these posts from showing in the XML sitemap, without having to edit the Yoast settings and excluding them one-by-one?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter LNBridges

    (@usoblogger)

    I set these posts to draft for the time being, but there are about 130, and a new one is added weekly, so the ideal solution would be to use a wildcard to exclude these URLs from the XML sitemap automatically. Let me know if there’s any way to do that 🙂

    Hi @usoblogger

    The best approach is to create CPT (custom post type) for these posts. On this way, you can exclude this CPT from the sitemap. It’s possible to add these posts without adding prefix (same as builtin post/page). I’ve good experience with CPT because I can create custom CSS for all these posts or set all posts to noindex (centralized) or whatever which I need. I can send PHP snippet for CPT.

    Also, if you set post to noindex, then it’s also excluded from sitemap. I don’t know if it helps.

    There are WP filters for sitemap URLs (wpseo_sitemap_entry), so you can create PHP code which will remove them.

    Regards,
    Sasa

    • This reply was modified 8 years, 9 months ago by Saša.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Exclude URLs from XML Using a Rule?’ is closed to new replies.