-
How can I exclude include individual specific pages from RankMath?
- This topic was modified 5 years, 4 months ago by CharlieB.
-
Hello,
Thank you for contacting Rank Math today.
I am afraid that your question is not very clear, would you mind sharing some context on what you are trying to achieve so that we can advise further?
Looking forward to helping you. Thank you.
​​​​​​
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Well that didn’t go well. I typed an entire message and wanted to add my Sensitive Data and when I did I lost everything that I typed.
I have a directory Plugin that uses 2 Pages domain.com/usa and domain.com/business to display directory pages from an API call. When I am using RankMath I end up with 2 Canonicals on hundreds of USA Business directory pages. See link to Screenshot. I know it is a strange setup but that is how it is. Their plugin also will inject schema and some other SEO so I need to disable RankMath on those two pages. And you know having two Canonicals is not a good thing.
So hence my question “How can I exclude include individual specific pages from RankMath?”
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
Thank you for the follow up.
You can make use of the following code to exclude a certain page from the Rank Math actions:
add_action( 'wp_head', 'rankmath_disable_features',1); function rankmath_disable_features() { if( is_page( $page_id) ) { remove_all_actions( 'rank_math/head'); }
Looking forward to helping you. Thank you.
​​​​​​
Michael,
Thanks but I have a few questions.
1. How exactly and where would I put the page ID in this code?
2. For page ID’s 58 & 59, how would I enter both ID’s in the code?
3. Can I put this in the Header Footer Code Manager Snippet or does this get added to the Theme Functions or where?Thanks. I know just enough about code to be dangerous. LOL
Hi Charlie,
Apologies for the delay.
This code should be added to your theme’s functions.php file.
Here is how the code can be modified for the two pages:add_action( 'wp_head', 'rankmath_disable_features',1); function rankmath_disable_features() { $page_id = array('58','59'); if( is_page( $page_id) ) { remove_all_actions( 'rank_math/head'); } }
I hope this info helps. Thank you.
Thanks Michael,
I added to the functions.php of my theme but it didn’t affect those pages as RankMath was still active on it. I wonder if it might be because those pages are generated by a plugin and not the theme? Just grasping for ideas.
I added an admin login if you might be able to check the site. Otherwise appreciate your thoughts. Thanks.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Michael,
I got it working! Problem was I had to reinstall the plugin and the page ID’s changed. After I changed it to the correct page ID’s it works perfectly.
Thanks! Really appreciate it.
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/?rate=5#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 ‘Exclude Pages from RankMath?’ is closed to new replies.