-
Newly created Redirects not working with Avada Theme- Redirects that were imported upon install from Yoast work.,
-
Hello,
I’m sorry to hear that you are facing issues with newly created redirects not working with the Avada theme. If the redirects that were imported upon installation from Yoast are working fine, it indicates that the issue might be related to how the redirects are being created or managed within Rank Math.
To troubleshoot this issue, you can follow these steps:
-
Check Redirection Settings: Ensure that the newly created redirects are correctly set up in Rank Math. You can verify this by navigating to Rank Math SEO → Redirections in your WordPress admin area.
-
Verify Redirect Rules: Double-check the redirect rules for the newly created redirects to ensure they are correctly configured and pointing to the intended destination.
-
Check for Plugin/Theme Conflicts: Sometimes, conflicts with other plugins or themes can affect how redirects work. Temporarily deactivate other plugins and switch to a default WordPress theme like Twenty Twenty-One to see if the issue persists.
-
Update Rank Math: Make sure you are using the latest version of Rank Math as older versions might have compatibility issues with certain themes.
If after following these steps the issue persists, please feel free to reply to this ticket, and a human agent from the Rank Math Support team will assist you further.
Thank you for your understanding and patience.
Sources:
Solving Redirection Issues Using Rank Math SEO Plugin » Rank Math
How to Import Redirects to Rank Math SEO » Rank Math
How to Create & Edit Redirects Using CSV » Rank Math
Random URLs Redirecting Even When No Redirect Was Created » Rank MathHello,
I have followed the steps and activated the debug and the issue persists.
See screenshot here > https://nimb.ws/qIDySEK
Hello Support,
Any updates on this. I noticed a login from:
A user with username “RankMath” who has administrator access signed in to your WordPress site.
User IP: 197.211.59.14Did you resolve the issue?
Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
We checked your website and found that you’re using the Permalink Manager plugin on your site and most probably that’s why you were facing the issue because both Rank Math and the Permalink Manager plugin use the same hook and sometimes it overrides the rules set by Rank Math.
That’s why we added the following filter to your theme’s
functions.php
file and now the redirections are working properly without any issues:add_action( 'wp', function () { global $wp; if ( ! empty( $wp->query_vars['do_not_redirect'] ) ) { if ( class_exists( 'RankMath\Helper' ) ) { $rank_math_modules = RankMath\Helper::get_module( 'redirections' ); add_action( 'template_redirect', array( $rank_math_modules, 'do_redirection' ), 11 ); } } }, 2 );
Hope that helps and please don’t hesitate to let us know if you have any other questions.
Thank you.Hello Support,
Thank you so very much for your help! The redirects are working now.
Question: Will the added filter be overwritten when the Avada Theme is updated? Or for any other reason?
we added the following filter to your theme’s functions.php file and now the redirections are working properly without any issues:
add_action( ‘wp’, function () {
global $wp;
if ( ! empty( $wp->query_vars[‘do_not_redirect’] ) ) {
if ( class_exists( ‘RankMath\Helper’ ) ) {
$rank_math_modules = RankMath\Helper::get_module( ‘redirections’ );
add_action( ‘template_redirect’, array( $rank_math_modules, ‘do_redirection’ ), 11 );
}
}
}, 2 );Hello,
The filter will be overwritten when you update the Avada Theme.
To prevent this, you can place the code using the Code Snippet plugin or by adding the code using a child’s theme.
You may refer to this guide on how to add the filter to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/#code-snippets-plugin
Hope that helps
Hi, Thank you. If I place the code in the child theme, does the child theme need to be active?
Hello,
Yes, if you place the code in the child theme, the child theme needs to be active for the code to run. The active theme (whether it is a parent or child theme) is the one that WordPress uses to render your site and execute the PHP code within it.
Here’s a brief explanation:
1) Active Theme: WordPress executes the code in the currently active theme. If your child theme is not active, the code you place there will not be executed.
2) Child Theme: A child theme inherits the functionality and styling of the parent theme and allows you to modify or add to the parent theme’s functionality without altering the parent theme’s files directly. This ensures that your modifications are preserved when the parent theme is updated.
3) Placing Code: If you add custom code (like hooks, filters, or custom functions) in the
functions.php
file of your child theme, it will only be executed if the child theme is the active theme.So, make sure your child theme is active to ensure that any custom code you add to it is executed.
We hope that clarifies things for you.
If you have any questions or need more help, please let me know.
Thank you for choosing Rank Math!
Thanks again! Excellent Support!!
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.
-
The ticket ‘Newly created Redirects not working with Avada Theme’ is closed to new replies.