• Resolved meenakshisanyal

    (@meenakshisanyal)


    Hi Plugin Developers ,

    Can you guys please help me removing the sitemap for tribe_events . We dont want https://www.chirec.ac.in/tribe_events-sitemap.xml in our website sitemap. We have tried to remove this using Yoast Plugin but its still showing there . Please provide us a option with which we can enable or disable the sitemap . Or some other solution if you have . Please help as soon as possible because its on high priority at our end. Please visit this url to check https://www.chirec.ac.in/sitemap_index.xml

    Thanks,
    Meenakshi Sanyal

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • John Beacham

    (@jdbeacham)

    Hey @meenakshisanyal,

    Thanks for sharing your issue and your urgency. I know how it feels when you cannot get things to work the way you want them to. ??

    It looks like you can exclude post types from the sitemap using this hook: https://developer.www.ads-software.com/reference/hooks/wp_sitemaps_post_types/

    Our post type is tribe_events.

    Hope this helps and please let us know if you have any questions.

    Best regards,
    John

    Thread Starter meenakshisanyal

    (@meenakshisanyal)

    Hi John,

    Thanks for your prompt reply . I appreciate that.

    We have tried the hook you suggested but still tribe_events sitemap is not going away. I don’t understand how plugin is setting up it in our website sitemap and no action is removing it .  

    Please help me or suggest me something.

    Thanks,

    Meenakshi Sanyal

    John Beacham

    (@jdbeacham)

    Hey @meenakshisanyal,

    Was really hoping that WordPress hook would work for you and I share any disappointment you feel that it did not! ??

    It looks like Yoast is taking over the sitemap on your site and I am not really sure how much we have to do with the issue honestly as our event post_type must be public and searchable by default.

    Since you are using Yoast, maybe their filter to exclude post types from the sitemap will work here: https://developer.yoast.com/features/xml-sitemaps/api/#exclude-specific-posts

    Here’s the example filter from Yoast’s site:

    function sitemap_exclude_post_type( $excluded, $post_type ) {   
    return $post_type === 'recipes';
    }
    add_filter( 'wpseo_sitemap_exclude_post_type', 'sitemap_exclude_post_type', 10, 2 );

    I am routing for this to work for you. If it does not, I would contact Yoast.

    I did some digging around our codex and put together a snippet that worked for me to make our post type not publicly searchable, but that might be farther reaching than just excluding it from the sitemap. I do not currently have a test site that is index-able, so I was not able to test to see if it worked on the sitemap:

    add_filter( 'tribe_events_register_event_type_args', 'xml_no_tribe', 10, 1 );

    function xml_no_tribe( $post_type_args ) {
    $post_type_args['publicly_queryable'] = false;
    return $post_type_args;
    }

    Hope this helps and please let me know if you have any questions.

    Best!
    John

    Thread Starter meenakshisanyal

    (@meenakshisanyal)

    Dear John,

    I hope this message finds you well. I wanted to express my heartfelt gratitude for the invaluable assistance you provided. Thanks to your expertise, the solution you suggested worked like a charm!

    I am truly delighted that our problem is now resolved, and I deeply appreciate the effort and time you dedicated to helping me.

    Best !
    Meenakshi Sanyal

    Hey @meenakshisanyal,

    You’re welcome and that’s great news!!! ??

    Just out of curiosity, which snippet did you end up using?

    Best regards,
    John

    Thread Starter meenakshisanyal

    (@meenakshisanyal)

    Hey John ,

    I used this one below :

    function sitemap_exclude_post_type( $excluded, $post_type ) {
    return $post_type === 'tribe_events';
    }
    add_filter( 'wpseo_sitemap_exclude_post_type', 'sitemap_exclude_post_type', 10, 2 );

    and it worked.

    Thanks,
    Meenakshi

    Plugin Support tristan083

    (@tristan083)

    Hi @meenakshisanyal ,

    Thank you for your message and for sharing the information.

    We’ll take note of this solution for future interaction with users of The Events Calendar.

    I’ll be closing this thread now, but please do not hesitate to bump a new thread on our way if you have further questions/concerns. This is for us to track down topics/issues efficiently and for us to follow the WordPress Forum Guidelines.

    If you have some time to review, that would be amazing!
    https://www.ads-software.com/support/plugin/the-events-calendar/reviews/

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.