Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @aitpro,

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

    You can whitelist the htaccess rules just like they did for your other SEO plugin.

    Adding this compatibility code will just increase our plugin size and it’ll also be hard to maintain it.

    With that being said, there are existing feature requests, so I’ve added your vote to our internal suggestions lists. If your suggestions are something that we’re able to introduce, I’ll be sure to let you know.

    If there’s anything else we can help you with, please let us know. We are here to assist.

    Thread Starter AITpro

    (@aitpro)

    My findings were just a heads up for you guys. If users are using the BPS htaccess file or a custom htaccess file or code that contains htaccess code that ModSecurity blocks then users will see a 403 error when trying to save their Rank Math General Settings options. The simple solution is just to remove the Edit .htaccess option from your plugin.

    Logically anyone who is using additional htaccess security code/files would already have a method to edit htaccess files. So they would not need to use the .htaccess editor in Rank Math. For everyone else they would be using the default WP htaccess code and would also not need to edit .htaccess files.

    • This reply was modified 3 years, 3 months ago by AITpro.
    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @aitpro

    You can use the following filter to remove the option:
    https://rankmath.com/kb/filters-hooks-api-developer/#add-remove-section

    Example code to remove htaccess:

    add_filter( 'rank_math/settings/general', function( $tabs) {
    	unset( $tabs['htaccess'] );
    	return $tabs;
    });

    Hope that helps. Thank you.

    Thread Starter AITpro

    (@aitpro)

    Excellent! I’ll add this filter in the BPS and BPS Pro plugins. Logically if someone is using BPS or BPS Pro then they will be using the BPS htaccess File Editor to edit htaccess files.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘ModSecurity preventing plugin options from being saved’ is closed to new replies.