How to Remove or Customize Rank Math SEO Elements on Your WordPress Site
Content
Many WordPress users leverage the powerful Rank Math SEO plugin to optimize their sites. However, a common need arises to customize its interface or output, such as removing comments from the page source, hiding SEO scores on specific pages, or disabling meta boxes for certain user roles or post types. This guide covers the most frequent requests and their solutions.
Why Would You Want to Remove These Elements?
There are several valid reasons for wanting to clean up Rank Math's output or backend interface:
- Cleaner Code: Removing plugin credit comments and unnecessary inline CSS can lead to cleaner HTML source code.
- Improved User Experience: Site administrators may want to simplify the WordPress admin for clients or other users by hiding complex SEO meta boxes and fields they don't need.
- Performance: While minor, disabling unused features can slightly reduce page load times.
- Custom Design: You may want to reposition or restyle certain elements, like breadcrumbs, to better fit your site's design.
Common Solutions for Customizing Rank Math
1. Removing the Plugin Credit Comment
The most common request is to remove the comment Rank Math adds to your page's HTML source:
<!-- Search Engine Optimization by Rank Math - https://rankmath.com/ -->
Solution: Add the following filter to your theme's functions.php file or a code snippets plugin:
add_filter( 'rank_math/frontend/remove_credit_notice', '__return_true' );
2. Hiding SEO Meta Boxes and User Profile Fields
To remove Rank Math SEO fields from user profile edit pages:
Solution via Settings: Navigate to Rank Math SEO → Titles & Meta → Authors. Ensure you are in Advanced Mode, then disable the "Add SEO Controls" option.
Solution via Code (for specific user meta fields): Use a filter to target specific social profile fields (e.g., Twitter, Facebook).
3. Disabling the SEO Score on Specific Pages/Posts
To hide the SEO score display, for example, on WooCommerce product pages:
add_filter( 'rank_math/show_score', function () {
if ( is_product() ) { // Target WooCommerce product pages
return false;
}
} );
4. Removing Inline CSS (e.g., for TOC Block)
To dequeue the inline CSS added by the Table of Contents block:
add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_style( 'rank-math-toc-block-style' );
}, 9999 );
5. Controlling Breadcrumb Display
To prevent breadcrumbs from appearing on the homepage:
<?php
if ( function_exists( 'rank_math_the_breadcrumbs' ) && ! is_front_page() ) {
rank_math_the_breadcrumbs();
}
?>
6. Disabling Features for Custom Post Types
Completely removing Rank Math's interface from a custom post type's admin screens requires multiple filters. This involves removing meta boxes, admin table columns, and other elements, which typically requires a more custom and comprehensive code solution.
Important Notes on Implementation
- Where to Add Code: Always add custom code to your child theme's
functions.phpfile or use a reputable code snippets plugin to avoid losing modifications after theme updates. - Clear Caches: After implementing these changes, clear any caching plugins or server-side caches to see the results immediately.
- Plugin Updates: These filters are based on the plugin's API. The Rank Math team strives to keep them stable, but it's good practice to verify functionality after major plugin updates.
By using these targeted solutions, you can tailor the Rank Math SEO experience to fit your specific website needs, creating a cleaner environment for both visitors and content editors.
Related Support Threads Support
-
Rankpahttps://wordpress.org/support/topic/rankpa/
-
Hide score on product pagehttps://wordpress.org/support/topic/hide-score-on-product-page/
-
remove rankmath metatag comment/ remove canonical to pagination pageshttps://wordpress.org/support/topic/remove-rankmath-metatag-comment-remove-canonical-to-pagination-pages/
-
Request for Correct CSS to Hide “Set to About” and …https://wordpress.org/support/topic/request-for-correct-css-to-hide-set-to-about-and/
-
Can I disable autoloaded options?https://wordpress.org/support/topic/can-i-disable-autoloaded-options/
-
rank-math-review-snippet.csshttps://wordpress.org/support/topic/rank-math-review-snippet-css/
-
How to Display Admin Toolbar Sub-Menu Links in Alphabetical Orderhttps://wordpress.org/support/topic/how-to-display-admin-toolbar-sub-menu-links-in-alphabetical-order/
-
How to turn off Rank Math Seo on the user profile?https://wordpress.org/support/topic/how-to-turn-off-rank-math-seo-on-the-user-profile/
-
Updated Filters and Hookshttps://wordpress.org/support/topic/updated-filters-and-hooks/
-
GTIN SHORTCODEhttps://wordpress.org/support/topic/gtin-shortcode/
-
rank math bloat data not being removed on uninstallhttps://wordpress.org/support/topic/rank-math-bloat-data-not-being-removed-on-uninstall/
-
Remove RankMath options from Custom Post Typehttps://wordpress.org/support/topic/remove-rankmath-options-from-custom-post-type/
-
hide backendhttps://wordpress.org/support/topic/hide-backend-7/
-
Microsoft Clarity codehttps://wordpress.org/support/topic/microsoft-clarity-code/
-
/** * Add . */ add_filter messagehttps://wordpress.org/support/topic/add-add_filter-message/
-
Math Rank Admin filtershttps://wordpress.org/support/topic/math-rank-admin-filters/
-
Exclude rank math info from user-edit.phphttps://wordpress.org/support/topic/exclude-rank-math-info-from-user-edit-php/
-
How to remove custom user input fields for users added by RankMath SEO Pluginhttps://wordpress.org/support/topic/how-to-remove-custom-user-input-fields-for-users-added-by-rankmath-seo-plugin/
-
How to disable Rank math seo querieshttps://wordpress.org/support/topic/how-to-disable-rank-math-seo-queries/
-
Remove RankMath Breadcrumb on homepagehttps://wordpress.org/support/topic/remove-rankmath-breadcrumb-on-homepage/
-
Hide rank math from admin barhttps://wordpress.org/support/topic/hide-rank-math-from-admin-bar/
-
Is it possible to disable Rank Math for certain pages/posts?https://wordpress.org/support/topic/is-it-possible-to-disable-rank-math-for-certain-pages-posts/
-
clean uninstallhttps://wordpress.org/support/topic/clean-uninstall-11/
-
How to Edit or disable page generated by Rank Mathhttps://wordpress.org/support/topic/how-to-edit-or-disable-page-generated-by-rank-math/
-
How to remove rankmath elements from sidebar in gutenberghttps://wordpress.org/support/topic/how-to-remove-rankmath-elements-from-sidebar-in-gutenberg/
-
How can we disable all those “bulk actions” options ?https://wordpress.org/support/topic/how-can-we-disable-all-those-bulk-actions-options/
-
Remove inline csshttps://wordpress.org/support/topic/remove-inline-css-14/
-
Can I move rank_math/json_ld to footerhttps://wordpress.org/support/topic/can-i-move-rank_math-json_ld-to-footer/
-
How to prevent specific .php template from being filled by RankMathhttps://wordpress.org/support/topic/how-to-prevent-specific-php-template-from-being-filled-by-rankmath/
-
How to Disable Latest Blog Posts from Rank Math | RM Dashboard (Backend)https://wordpress.org/support/topic/how-to-disable-latest-blog-posts-from-rank-math-wp-admin-dashboard/
-
How to remove rank math comment in front end by default ?https://wordpress.org/support/topic/how-to-remove-rank-math-comment-in-front-end-by-default/
-
Rankmath TOC togglehttps://wordpress.org/support/topic/rankmath-toc-toggle/
-
How to remove WYSIWYG on category description fieldhttps://wordpress.org/support/topic/how-to-remove-wysiwyg-on-category-description-field/