Disable certain test from rank math

#544410
  • Resolved Marco Ho
    Rank Math free

    I want to disable two test because it is not applicable to my chinese contents. I didn’t see the rank math php under theme editor to add the filter. Please help

Viewing 9 replies - 1 through 9 (of 9 total)
  • Disable the Keyword in Permalink Test
    Disable the Length of the Content Test

    Hello,

    Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.

    The rank-math.php file should be created manually in your theme/child theme directory. Please follow the steps in this link:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/#num-2-1-create-rank-math-php-file

    Once done, insert this filter to disable the tests you have mentioned:

    /**
     * Filter to disable multiple SEO Contest tests
     */
    add_filter('rank_math/researches/tests', function ($tests, $type) {
    	unset(
    $tests['lengthContent'],
    $tests['keywordInPermalink']
    );
    return $tests;
    }, 10, 2 );

    Hope that helps.

    Thank you.

    After i added the filter, there is a weird thing in my webpage, the filter text is on the top of my webpage. what’s the problem?

    and the elementor editor won’t load for my editing.

    Hello,

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    I am using my domain host cpanel to add the rank math.php folder. So you need login to my domain host as well?

    Hello,

    We would need FTP to make the edits as sometimes we need to test few things.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Thank you

    any other ways to ignore the testing because i don’t want to do too much changes to the backend code

    Hello,

    Sorry, but there’s no other way to disable the tests.

    Most likely you didn’t add <?php at the top of the rank-math.php file. Can you please replace the above one with the following one to see if that works for you?

    <?php
    
    /**
     * Filter to disable multiple SEO Contest tests
     */
    add_filter('rank_math/researches/tests', function ($tests, $type) {
    	unset(
    $tests['lengthContent'],
    $tests['keywordInPermalink']
    );
    return $tests;
    }, 10, 2 );

    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 9 replies - 1 through 9 (of 9 total)

The ticket ‘Disable certain test from rank math’ is closed to new replies.