Having trouble firing add_filter( ‘rank_math/modules’,

#129432
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.

    You can customize that filter to add/remove/change modules and add it in your theme’s functions.php file to work. Could you also provide the options you are trying to create and the ones you wanted to remove?

    I hope that helps. Thank you, and looking forward to your update.

    Hi Reinelle,

    Thank you for your reply.

    The problem is that the filter is not getting called at all!

    Trying something like this makes it very apparent as it is completely transparent:

    add_filter( ‘rank_math/modules’, ‘die’, 10, 1);
    function die ($modules) {
    die();
    }

    Let me know an example of its use, let’s say to remove the 404-monitor?

    Kind regards

    Hello,

    Sorry for the delay.

    Here’s an example filter to disable the Rich Snippet module:

    add_filter( 'rank_math/modules', function( $modules ) {
        unset( $modules['rich-snippet'] );
        return $modules;
    } );

    Please create a new file called rank-math.php in your theme folder and add the code in there. This code will not work in the functions.php file.

    I hope that helps. Thank you, and please don’t hesitate to contact us if you need further assistance.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘Having trouble firing add_filter( ‘rank_math/modules’,’ is closed to new replies.