Hello, we apologize for the inconvenience you’re facing with Rank Math not working due to different home and site URLs in the wp_config file.
To resolve this issue, you can try adding the following filter to your website and reconnecting to your Rank Math account:
/**
* Filter whether we need to check for URL mismatch or not.
*/
add_filter( 'rank_math/registration/do_url_check', '__return_false' );
This should allow Rank Math to work properly even with different home and site URLs.
If the issue persists, please try disconnecting and reconnecting your Rank Math account after adding the filter. If you still encounter problems, feel free to reach out to our dedicated support team for further assistance.
Thank you for bringing this to our attention, and we appreciate your patience as we work to resolve this issue.
Sources:
Fatal Error Happening on Some Installations After 1.0.49 Update » Rank Math
Why Rank Math Settings Are Not Getting Saved? » Rank Math
How to Fix Problems While Connecting Account Using Rank Math » Rank Math
The #1 WordPress SEO Plugin in 2023 – Rank Math
where do we have to paste this filter code ?
This is not working
can you please assign somebody to help
its urgent
Hello,
Apologies for the inconvenience.
The filter should be added to your theme or child theme’s functions.php file.
Alternatively, you can follow the other methods mentioned in our guide here:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Looking forward to helping you.
Tried all three ways, still not working
giving that error msg <> site and home url are different
please provide some solution as it is very urgent and critical
Hello,
In this case, 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.

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.
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.