Question about Filters & Hooks for Developers

#431102
  • Hey guys, I hope you’re doing well!

    I’ve been using Rank Math for quite some time already and found this article recently:

    https://rankmath.com/kb/filters-hooks-api-developer/

    While Rank Math has so many great features, I always found it a bit overwhelming and hard to find the options when you don’t need many. Now, I’m customizing the modules and sections and removing everything I don’t need.

    So far it worked great, but I still have a few questions:

    (1) When I remove the module/section, is it actually disabled or just not visible in the WordPress Dashboard/Backend?

    (2) I’ve tried to remove “Attachments” from “Sitemap Settings” using this code, but it doesn’t work:

    add_filter( ‘rank_math/sitemap’, function( $tabs) {
    unset( $tabs[‘attachment’] );
    return $tabs;
    });

    (3) Is it possible to remove options on the deepest level individually? For example, “General Settings” > “Links” > “Strip Category Base”?

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    1. When you deactivate a module the functionality from it is also removed from the plugin. For example, if you deactivate the sitemap module you won’t get a sitemap generated for your website.

    ​​​​​​2. That filter is not valid and if you want to control which tabs load for the sitemap settings you can use the following filter instead:

    
    add_filter( 'rank_math/settings/sitemap', function( $tabs ) {
        return $tabs;
    });
    

    3. No, you either remove the entire tab or keep the entire set of settings that are nested inside the tab.

    Don’t hesitate to get in touch if you have any other questions.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.