{"id":388694,"date":"2021-10-09T07:42:46","date_gmt":"2021-10-09T07:42:46","guid":{"rendered":"https:\/\/rankmath.com\/?post_type=ht_kb&#038;p=388694"},"modified":"2026-05-06T14:15:11","modified_gmt":"2026-05-06T14:15:11","slug":"filters-hooks-api-developer","status":"publish","type":"ht_kb","link":"https:\/\/rankmath.com\/es\/kb\/filters-hooks-api-developer\/","title":{"rendered":"Rank Math SEO Filtros y ganchos para desarrolladores"},"content":{"rendered":"<p>We have incorporated various hooks and filters in the Rank Math SEO plugin that developers can use to interact with data output by Rank Math. You can control Rank Math data from within your themes\/plugins. Before going through the different filters and hooks that Rank Math offers, we&#8217;d discuss how to add them to your website.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"adding-filters-and-hooks-in-rank-math-php\">Adding Filters and Hooks in rank-math.php<\/h2>\n\n\n\n<p>We recommend adding these filters to <code>wp-content\/themes\/theme-name\/rank-math.php<\/code> as it involves benefits like:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"num-1-flexibility-in-switching-themes\"><span class=\"number\">1<\/span>  Flexibility in Switching Themes<\/h3>\n\n\n\n<p>When you add code snippets to your theme&#8217;s functions.php, you run the risk of losing all your customizations added while switching themes, and it would be really tedious to identify all Rank Math code snippets used and add the same to your new theme.<\/p>\n\n\n\n<p>By adding all Rank Math SEO code snippets in a separate file, you&#8217;ll have the flexibility to switch themes. All you&#8217;ve to do is download a copy of your rank-math.php file from your old theme and upload it to your new theme folder. Then, all your Rank Math customizations will work the same way as before.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"num-2-code-runs-only-with-the-plugin\"><span class=\"number\">2<\/span>  Code Runs Only with the Plugin <\/h3>\n\n\n\n<p>When you add a filter to your theme&#8217;s functions.php, the code runs on your website even when the Rank Math plugin is not active. But when added to the rank-math.php file, the code runs only when the Rank Math plugin is active, as the plugin includes the file. This practice will help you ensure that your site runs as fast as possible.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"num-3-ensures-all-rank-math-functions-work\"><span class=\"number\">3<\/span>  Ensures All Rank Math Functions Work<\/h3>\n\n\n\n<p>Some filters like the one involving customizing OpenGraph need to be wrapped in the <code>wp_head<\/code> hook. There are many reasons why they may not perform as intended when added to functions.php, and to work as expected, they need to be added to rank-math.php.<\/p>\n\n\n\n<p>To keep things less complicated, we recommend adding all the Rank Math functions to rank-math.php instead of adding them to your theme&#8217;s functions.php.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-add-code-snippets-to-rank-math-php\">How to Add Code Snippets to rank-math.php?<\/h2>\n\n\n\n<p>To start adding code snippets to rank-math.php, you&#8217;ll need to create the file first. You can easily do this with an FTP or cPanel File Manager. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"num-1-create-rank-math-php-file\"><span class=\"number\">1<\/span>  Create rank-math.php File<\/h3>\n\n\n\n<p>If you&#8217;re using FTP, navigate to your theme&#8217;s folder (\/wp-content\/themes\/theme-name\/) and then create a new file named rank-math.php as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1280\" height=\"800\" src=\"https:\/\/rankmath.com\/wp-content\/uploads\/2021\/05\/Creating-rank-math.php-file-with-FTP.jpg\" alt=\"Creating rank-math.php file with FTP\" class=\"wp-image-853030\" \/><\/figure>\n\n\n\n<p>If you&#8217;re using cPanel, then you can use their File Manager to create your new file named rank-math.php inside your theme folder (\/wp-content\/themes\/theme-name\/) as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1280\" height=\"712\" src=\"https:\/\/rankmath.com\/wp-content\/uploads\/2021\/05\/Creating-rank-math.php-file-with-cPanel-File-Manager.jpg\" alt=\"Create rank-math.php file with cPanel Manager\" class=\"wp-image-853003\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"num-2-navigate-to-theme-file-editor\"><span class=\"number\">2<\/span>  Navegar al editor de archivos de temas<\/h3>\n\n\n\n<p>Una vez que haya creado el archivo Rank Math en su carpeta de temas, puede editar el archivo navegando a <strong>Appearance \u2192 Theme File Editor<\/strong> (para tema cl\u00e1sico) o <strong>Tools \u2192 Theme File Editor<\/strong> (para Block Theme) en su \u00e1rea de administraci\u00f3n de WordPress. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"900\" height=\"359\" src=\"https:\/\/rankmath.com\/wp-content\/uploads\/2022\/03\/Navigate-to-Theme-File-Editor.png\" alt=\"Navegar al editor de archivos de temas\" class=\"wp-image-1051705\" \/><\/figure>\n\n\n\n<p>The right side of your screen lists all the theme files and templates. The files being shown here would vary depending upon the theme you&#8217;re using on your website. You can access the rank-math.php file you had created in the previous step from the list of files.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/rankmath.com\/wp-content\/uploads\/2022\/02\/image-41.png\" alt=\"Open rank-math.php in from Theme file Editor\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"num-3-adding-your-code\"><span class=\"number\">3<\/span>  Adding your Code<\/h3>\n\n\n\n<p>You&#8217;d be able to see the code editor available in the middle of your screen, and here is where you can add the code snippets (which we would discuss in this article shortly).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1105\" height=\"625\" src=\"https:\/\/rankmath.com\/wp-content\/uploads\/2021\/05\/Use-Rank-Math-filters-and-hooks.jpg\" alt=\"Use Rank Math filters and hooks\" class=\"wp-image-853980\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"num-4-saving-changes\"><span class=\"number\">4<\/span>  Guardando cambios<\/h3>\n\n\n\n<p>Once you&#8217;ve added the code snippet, click the <strong>Actualizar archivo<\/strong> button at the bottom of the screen to save your changes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"887\" height=\"429\" src=\"https:\/\/rankmath.com\/wp-content\/uploads\/2021\/05\/rank-math.php-update-file.jpg\" alt=\"rank-math.php update file\" class=\"wp-image-854002\" \/><\/figure>\n\n\n\n<p>While adding your code snippet, if you&#8217;ve accidentally made any mistake that would crash your site, then the theme file editor will throw an error without saving the file so that you can fix them immediately. Once you&#8217;ve successfully updated the file, you can check your site for changes\/configurations intended with the filter\/hook.<\/p>\n\n\n\n<p>Now that we&#8217;ve understood how to use the rank-math.php file, we&#8217;ll look at the different filters and hooks available for you to use.<\/p>\n\n\n\n<div id=\"toc\">\n<h2>Tabla de contenido<\/h2>\n<ul>\n<li><a href=\"#settings\">Administraci\u00f3n<\/a>\n<ul>\n<li><a href=\"#settings\">Ajustes<\/a><\/li>\n<li><a href=\"#sitemap\">mapa del sitio<\/a><\/li>\n<li><a href=\"#podcast\">Podcast<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#breadcrumbs\">Frontend<\/a>\n<ul>\n<li><a href=\"#breadcrumbs\">Migas de pan<\/a><\/li>\n<li><a href=\"#metadata\">Meta Data<\/a><\/li>\n<li><a href=\"#opengraph\">OpenGraph<\/a><\/li>\n<li><a href=\"#richsnippets\">Fragmentos enriquecidos<\/a><\/li>\n<li><a href=\"#seo-score\">Puntuaci\u00f3n SEO<\/a><\/li>\n<li><a href=\"#redirections\">Redirecciones<\/a><\/li>\n<li><a href=\"#ai-link-genius\">AI Link Genius<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#gutenberg\">Gutenberg<\/a><\/li>\n<li><a href=\"#elementor\">Elementor<\/a><\/li>\n<li><a href=\"#divi\">Divi<\/a><\/li>\n<li><a href=\"#misc\">Misc<\/a><\/li>\n<\/ul>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"settings\">Ajustes<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-metabox-priority\">1. Filter to change the Rank Math Metabox priority.<\/h3>\n\n\n\n<p>Use this filter to change the Rank Math metabox priority to low, so it appears after other metaboxes like ACF fields.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Change the Rank Math Metabox Priority\n *\n * @param array $priority Metabox Priority.\n *\/\nadd_filter( 'rank_math\/metabox\/priority', function( $priority ) {\n return 'low';\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"unlimited-keywords\">2. Filter to change the Focus Keyword Limit<\/h3>\n\n\n\n<p>Use this filter to increase or decrease the number of maximum focus keywords that can be added to the single post or page editor.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Change the Focus Keyword Limit\n *\/\nadd_filter( 'rank_math\/focus_keyword\/maxtags', function() {\n    return 10; \/\/ Number of Focus Keywords. \n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-remove-section\">3. Filter to add\/remove section into the General Settings option panel.<\/h3>\n\n\n\n<p>This filter allows you to add or remove a section from the general settings options panel of the Rank Math plugin.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to add new section into general setting option panel.\n *\n * @param array $tabs\n *\/\nadd_filter( 'rank_math\/settings\/general', function( $tabs) {\n\tunset( $tabs&#091;'htaccess'] ); \/\/ Unsets Edit .htaccess tab.\n\treturn $tabs;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-remove-into-title\">4. Filter to add\/remove section into the Title Settings option panel.<\/h3>\n\n\n\n<p>You can add or remove a custom section to or from the Title Settings option panel with this setting.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to add new section into general setting option panel.\n *\n * @param array $tabs\n *\/\nadd_filter( 'rank_math\/settings\/title', function( $tabs) {\n return $tabs;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-options-field\">5. Filter to allow developers to add option fields to check against update. And if updated, flush the rewrite rules<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to add option fields to check against updatation.\n * And if updated flush the rewrite rules.\n *\n * @param array $flush_fields Array of fields id for which we need to flush.\n *\/\nadd_filter( 'rank_math\/flush_fields', function( $fields) {\n return $fields;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-new-tab\">6. Filter to allow developers to add new tabs into the options panel.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to add new tabs into option panel.\n *\n * The dynamic part of hook is, page name without 'rank-math-' prefix.\n *\n * @param array $tabs\n *\/\nadd_filter( \"rank_math\/admin\/options\/{$filter}_tabs\", function( $tabs ) {\n return $tabs;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-content-analysis\">7. Filter to add\/update\/remove Content Analysis test.<\/h3>\n\n\n\n<p>This filter allows you to add\/update\/remove content analysis tests. For removing any test, you can simply unset the test&nbsp;<a href=\"https:\/\/rankmath.com\/kb\/disable-seo-content-tests\/\">as shown in this tutorial<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to modify the test.\n *\n * @param array  $tests Array of tests\n * @param string $type  Object type. Can be post, user or term.\n *\/\nadd_filter( 'rank_math\/researches\/tests', function( $tests, $type ) {\n return $tests;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<p>Similarly, if you want to disable any of the Content AI Research tests, then use the filter below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to modify the Content AI tests.\n *\n * @param array  $tests Array of tests\n *\/\nadd_filter( 'rank_math\/content_ai\/research_tests', function( $tests) {\n return $tests;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-items-per-import\">8. Filter to change a number of items to import per run. Used when importing data from other plugins<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Number of items to import per run.\n *\n * @param int $items_per_page Default 100.\n *\/\nadd_filter( 'rank_math\/importers\/items_per_page', function( $items_per_page ) {\n return $items_per_page;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-remove-from-admin-bar\">9. Filter to add\/remove the item from the Admin Bar node.<\/h3>\n\n\n\n<p>Add or remove an item from the WordPress admin-bar menu that Rank Math adds to the front-end of your WordPress website.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Add item to Rank Math admin bar node.\n *\n * @param array $items Array of nodes for Rank Math menu.\n *\/\nadd_filter( 'rank_math\/admin_bar\/items', function( $items ) {\n return $items;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-default-value-settings\">10. Add Default value for General Settings during plugin installation.<\/h3>\n\n\n\n<p>Set a default value for general settings when Rank Math is installed on a WP website. Refer to the options and&nbsp;<a href=\"https:\/\/github.com\/rankmath\/seo-by-rank-math\/blob\/eea089f0afe7f476d1f9dadc1a9f75377373d282\/includes\/class-installer.php#L319\" target=\"_blank\" rel=\"noreferrer noopener\">default values here<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Add defaults for general options.\n *\n * @param array $settings Array of settings and its values.\n *\/\nadd_filter( 'rank_math\/settings\/defaults\/general', function( $settings ) {\n return $settings;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"default-value-title-settings\">11. Add Default value for Title Settings during plugin installation.<\/h3>\n\n\n\n<p>Use this filter to set default values for SEO Title and Meta settings when Rank Math is installed on a website. Refer to the&nbsp;<a href=\"https:\/\/github.com\/rankmath\/seo-by-rank-math\/blob\/eea089f0afe7f476d1f9dadc1a9f75377373d282\/includes\/class-installer.php#L381\" target=\"_blank\" rel=\"noreferrer noopener\">options and default values here<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Add defaults for title options.\n *\n * @param array $settings Array of settings and its values.\n *\/\nadd_filter( 'rank_math\/settings\/defaults\/titles', function( $settings ) {\n return $settings;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"default-sitemap-settings\">12. Add Default value for Sitemap Settings during plugin installation.<\/h3>\n\n\n\n<p>Use the filter to set default values for sitemap settings. Refer to the options and&nbsp;<a href=\"https:\/\/github.com\/rankmath\/seo-by-rank-math\/blob\/eea089f0afe7f476d1f9dadc1a9f75377373d282\/includes\/class-installer.php#L374\" target=\"_blank\" rel=\"noreferrer noopener\">default values here<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Add defaults for Sitemap options.\n *\n * @param array $settings Array of settings and its values.\n *\/\nadd_filter( 'rank_math\/settings\/defaults\/sitemap', function( $settings ) {\n return $settings;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-remove-modules\">13. Allow developers to add\/remove\/change Modules.<\/h3>\n\n\n\n<p>Use this filter to modify or remove any existing modules available in Rank Math SEO plugin. You can also add any custom modules through this filter.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filters the array of modules available to be activated.\n *\n * @param array $modules Array of available modules.\n *\/\nadd_filter( 'rank_math\/modules', function( $modules ) {\n return $modules;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-author-base\">14. Filter to change the Author base.<\/h3>\n\n\n\n<p>Use this filter to change the URL base for author archives. When the author base is configured to use this filter, the&nbsp;<a href=\"https:\/\/rankmath.com\/kb\/titles-and-meta\/#author-base\">Author Base<\/a>&nbsp;set by the users under&nbsp;<strong>Rank Math SEO \u2192 Titles &amp; Meta \u2192 Authors<\/strong>&nbsp;will not have any effect.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to change the author base.\n *\n * @param string $base The author base.\n *\/\nadd_filter( 'rank_math\/author_base', function( $base ) {\n return $base;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-add-format\">15. Filter to change the address part format.<\/h3>\n\n\n\n<p>This filter lets you change the address part format for Rank Math&#8217;s&nbsp;<a href=\"https:\/\/rankmath.com\/kb\/local-seo\/#contact-info-shortcode\">Local SEO contact shortcode<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developer to change the address part format.\n *\n * @param string $parts_format String format  how to output address part.\n *\/\nadd_filter( 'rank_math\/shortcode\/contact\/address_parts_format', function( $format ) {\n return $format;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-location-query-args\">16. Filter to change the args in the locations query<\/h3>\n\n\n\n<p>This filter allows you to change the query arguments to retrieve locations when you use <a href=\"https:\/\/rankmath.com\/kb\/location-data-shortcode\/\">Location shortcode<\/a> y <a href=\"https:\/\/rankmath.com\/kb\/local-business-block\/\">Bloque de Negocios Locales<\/a> en Rank Math.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change Locations query args.\n *\n * @param  array $args Arguments to retrieve locations.\n * @return array $args.\n *\/\nadd_filter( 'rank_math\/location_args', function( $args ) {\n\t\/\/ Add your code here to change the args.\n\treturn $args;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-post-type-icons\">17. Filter to change Post type icons in the options panel.<\/h3>\n\n\n\n<p>Use this filter to update the icons for post types, such as posts, pages, products, etc, in Titles &amp; Meta settings as well as Sitemap settings. For each post type, you can assign a CSS class to specify the desired icon. You can also use this filter to define the default icon for any new post type.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developer to change post types icons.\n *\n * @param array $icons Array of available icons.\n *\/\nadd_filter( 'rank_math\/post_type_icons', function( $icons ) {\n return $icons;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-taxonomy-icons\">18. Filter to change Taxonomy icons in the options panel.<\/h3>\n\n\n\n<p>Use this filter to update the icons for taxonomies, such as categories, tags, etc, in Titles &amp; Meta settings as well as Sitemap settings. For each taxonomy, you can assign a CSS class to specify the desired icon. You can also use this filter to define the default icon for any new taxonomy.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developer to change taxonomies icons.\n *\n * @param array $icons Array of available icons.\n *\/\nadd_filter( 'rank_math\/taxonomy_icons', function( $icons ) {\n return $icons;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"enable-disable-overlay-icon\">19. Filter to enable\/disable overlay icon option in Social Tab in Post Settings.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developer to enable\/disable overlay icon option in Post Settings.\n *\n * @param string $value   Default is set to off.\n * @param string $service Can be faceboo or twitter.\n *\n *\/\nadd_filter( 'rank_math\/metabox\/social\/overlay_icon', function( $value, $service ) {\n return $value;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"enable-disable-link-suggestion-box\">20. Filter to enable\/disable Link Suggestion Metabox for the particular post type.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developer to enable\/disable Link Suggestion Metabox for specific post type.\n *\n * @param string $default   Default is set to on.\n * @param string $post_type Post type name.\n *\n *\/\nadd_filter( 'rank_math\/settings\/titles\/link_suggestions', function( $default, $post_type ) {\n return $default;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"set-default-snippet\">21. Filter to set default Snippet type for the post type.<\/h3>\n\n\n\n<p>Use this filter to set a default&nbsp;<a href=\"https:\/\/rankmath.com\/kb\/titles-and-meta\/#rich-snippet-type\">Schema type<\/a>&nbsp;for each post type under&nbsp;<strong>Rank Math SEO \u2192 Titles &amp; Meta<\/strong>&nbsp;settings.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developer to default Snippet type by post type.\n *\n * @param string $type      Snippet Type.\n * @param string $post_type Post type name.\n *\n *\/\nadd_filter( 'rank_math\/settings\/snippet\/type', function( $type, $post_type ) {\n return $default;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"default-snipper-article-type\">22. Filter to set default Snippet Article type for the post type.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developer to default Snippet Article type by post type.\n *\n * @param string $type      Article Type.\n * @param string $post_type Post type name.\n *\n *\/\nadd_filter( 'rank_math\/settings\/snippet\/article_type', function( $type, $post_type ) {\n return $type;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-custom-variable\">23. Filter to add custom variable replacements.<\/h3>\n\n\n\n<p>Use this filter to modify <code>nombre<\/code>,&nbsp;<code>descripci\u00f3n<\/code>,&nbsp;<code>variable<\/code>&nbsp;y&nbsp;<code>ejemplo<\/code> of existing Rank Math variables.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add custom variables\n *\/\nadd_filter( 'rank_math\/vars\/replacements', function( $vars ) {\n return $vars;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-extra-variables\">24.  Add Extra Variables to the Rank Math Dropdown in Title &amp; Meta Settings<\/h3>\n\n\n\n<p>This filter allows you to add additional variables that would appear in the Rank Math Titles &amp; Meta settings drop-down as well as in the&nbsp;<a href=\"https:\/\/rankmath.com\/kb\/general-tab\/#what-variables-are-supported\">Meta Box Snippet Editor<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Action: 'rank_math\/vars\/register_extra_replacements' - Allows adding extra variables.\n *\/add_action( 'rank_math\/vars\/register_extra_replacements', function(){\n rank_math_register_var_replacement(\n 'custom_variable_slug',\n &#091;\n 'name'        =&gt; esc_html__( 'Custom variable name.', 'rank-math' ),\n 'description' =&gt; esc_html__( 'Custom variable description.', 'rank-math' ),\n 'variable'    =&gt; 'custom_variable_slug',\n 'example'     =&gt; 'custom_variable_callback()',\n ],\n 'custom_variable_callback'\n );\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"show-hide-metabox\">25. Filter to show\/hide SEO Metabox.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to show\/hide SEO Metabox.\n *\/\nadd_filter( 'rank_math\/metabox\/add_seo_metabox', function( $default ) {\n return $default;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-separator\">26. Filter to change Separator %sep%.<\/h3>\n\n\n\n<p>This filter lets you set a&nbsp;<a href=\"https:\/\/rankmath.com\/kb\/general-settings\/#separator-character\">default separator<\/a>&nbsp;that is used in the title tags. If the separator character is set using this filter, then it will override the Separator Character set by users under&nbsp;<strong>Rank Math SEO \u2192 Titles &amp; Meta \u2192 Global Meta<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change Separator %sep%.\n *\/\nadd_filter( 'rank_math\/settings\/title_separator', function( $sep ) {\n return $sep;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-auto-update-email\">27. Filter to turn off auto-update notification emails.<\/h3>\n\n\n\n<p>This filter enables you to disable the auto-update notification emails from Rank Math. However, please note, disabling this email notification would not prevent auto-updates on your site.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to turn off auto-update notification emails.\n *\/\nadd_filter( 'rank_math\/auto_update_send_email', '__return_false' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"edit-auto-update-email\">28. Filter to edit the auto-update notification emails.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to edit the auto-update notification emails.\n *\/\nadd_filter( 'rank_math\/auto_update_email', function( $email, $version, $plugin_upgrader_obj ) {\n  $email&#091;'to_address'] = 'email@example.com';\n  $email&#091;'body'] = \"Rank Math has been updated to version {$version}.\";\n  return $email;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-custom-power-words\">29. Add Custom Power Words for Analysis<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add custom Power Words\n *\/\nadd_filter( 'rank_math\/metabox\/power_words', function( $words ){\n\t$new_words = &#091;\n\t\t'test-word1',\n\t\t'test-word2',\n\t\t'test-word3',\n\t];\n\treturn array_merge( $words, $new_words );\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-settings-mode\">30. Filter to change default Settings Mode(Easy or Advanced)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change default Settings Mode(Easy or Advanced)\n *\/\nadd_filter( 'rank_math\/setup_mode', function( $mode ) {\n    return $mode;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-csv-separator\">31. Filters to change the CSV separator character in the CSV Importer file<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the CSV separator character in the CSV Importer file\n *\/\nadd_filter( 'rank_math\/csv_import\/separator', function( $separator ) {\n    return ';';\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"hide-email-reporting-options\">32. Hide the Email Reporting Options<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to hide the Email Reporting Options\n *\/\nadd_filter( 'rank_math\/analytics\/hide_email_report_options', '__return_true' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"admin-email-id-for-email-reporting\">33. Use the admin email ID for Email Reporting<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'rank_math\/analytics\/email_report_parameters', function( $data ) {\n    $data&#091;'to'] = get_option( 'admin_email' );\n\treturn $data;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-email-seo-report-button-url\">34. Change the Email SEO Report Button URL<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'rank_math\/analytics\/email_report_variables', function( $vars ) {\n\t$vars&#091;'report_url'] = \"https::\/\/newlogin-url.com\";\n\treturn $vars;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"track-logged-in-user-role\">35. Google Analytics &#8211; Track certain user role even if Exclude Logged-In users option is ON<\/h3>\n\n\n\n<p>This filter overrides the <a href=\"https:\/\/rankmath.com\/kb\/general-settings\/#exclude-logged-in-users\">Exclude logged-in users<\/a> feature and lets you unset specific user roles from being ignored.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter(\n\t'rank_math\/analytics\/gtag_exclude_loggedin_roles',\n\tfunction( $roles ) {\n\t\tunset( $roles&#091;'customer'] ); \/\/ Track logged in customers.\n\t\treturn $roles;\n\t}\n);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-post-meta-table-limit\">36. Filter to change the Post Meta Table limit<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the Post Meta Table Limit\n *\/\nadd_filter('rank_math\/seo_analysis\/postmeta_table_limit', function ( $limit ) {\n\t\treturn 500000;\n\t}\n);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"allow-line-breaks\">37. Filter to allow line breaks in FAQ and HowTo Schema blocks<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: Allow developers to preserve line breaks.\n *\n * @param bool   $return If set, this will convert all remaining line breaks after paragraphing.\n * @param string $block  Block name.\n *\/\nadd_filter( 'rank_math\/block\/preserve_line_breaks', '__return_false' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-domain-checking\">38. Filter to Disable Domain Checking functionality<\/h3>\n\n\n\n<p>This filter bypasses the check for any mismatch in the Site Address and WordPress URL in the settings that can cause issues with activation on some setups.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter whether we need to check for URL mismatch or not.\n *\/\nadd_filter( 'rank_math\/registration\/do_url_check', '__return_false' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-sensitive-data-encryption\">39. Filter to Disable Sensitive Data Encryption<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/** * Filtro para deshabilitar el cifrado de datos confidenciales *\/ add_filter( &#039;rank_math\/admin\/SENSITIVE_data_encryption&#039;, &#039;__return_false&#039; );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-keyword-suggestions\">40. Filter to Disable Focus Keyword Suggestions from Google<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to Disable Keyword Suggestions from Google\n *\/\nadd_filter( 'rank_math\/metabox\/values', function( $args = &#091;] ) {\n    $args&#091;'autoSuggestKeywords'] = false;\n    return $args;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"csv-import-redirection-data\">41. Filter to Modify the Redirection data before updating a Redirection<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to modify the redirection data before updating a redirection.\n * Pass a false value to skip the update and create a new redirection instead.\n *\n * @param array|false $data Redirection data.\n *\/\nadd_filter('rank_math\/admin\/csv_import_redirection_update', function ($exist, $data) {\n    return $data;\n}, 10, 2);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exclude-post-types-analytics-index\">42. Filter to exclude post types from Analytics Index<\/h3>\n\n\n\n<p>Once you&#8217;ve made changes to the existing Analytics Index using this filter, be sure to <a href=\"https:\/\/rankmath.com\/kb\/rank-math-status-and-tools\/#rebuild-index-for-analytics\">rebuild the index<\/a> by heading over to <strong>WordPress Dashboard \u2192 Rank Math SEO \u2192<\/strong> <strong>Status &amp; Tools \u2192 Database Tools \u2192 Rebuild Index<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to exclude post types from Analytics Index.\n *\/\nadd_filter( 'rank_math\/analytics\/post_types', function( $post_types = &#091;] ) {\n    $excludes = &#091;\n        'page',\n    ];\n\n    return array_diff_key( $post_types, array_flip( $excludes ) );\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"indexnow-api-key-location\">43. Filter to change IndexNow API Key location<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the location of the IndexNow key file.\n * \n * @param string $location Location.\n *\/\nadd_filter( 'rank_math\/instant_indexing\/indexnow_key_location', function($location) {\n\t$location = 'https:\/\/yourdomain.com\/' . \\RankMath\\Helper::get_settings( 'instant_indexing.indexnow_api_key' ) . '.txt'; \/\/change your API Key location\n\treturn $location;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-indexnow-api-key\">44. Filter to change the IndexNow API Key<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the API key.\n *\n * @param string $api_key API key.\n *\/\nadd_filter( 'rank_math\/instant_indexing\/indexnow_key', function($api_key) {\n\treturn $api_key;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-pro-update-restrictions\">45. Filter to disable restrictions on updating PRO version before Free version<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove restrictions in updating PRO version before the Free version\n *\/\nadd_filter( 'rank_math\/updates\/remove_restrictions', '__return_true' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-rich-text-editor-taxonomy\">46. Filter to disable Rich Text Editor in a specific taxonomy<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to disable Rich Text editor in specific taxonomy.\n *\n * @param string $disable      Whether to disable the Rich Text editor.\n * @param string $taxonomy Taxonomy name.\n *\/\nadd_filter( 'rank_math\/admin\/disable_rich_editor', function( $disable, $taxonomy ) {\n\treturn true;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-local-seo-shortcode-output\">47. Filter to change Local SEO shortcode content<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the Local SEO shortcode output.\n * \n * @param string $html The HTML output of the shortcode.\n *\/\nadd_filter('rank_math\/contact_info\/html', function($html){\n\treturn $html;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-locations-front-base\">48. Filter to disable rewriting Front base for Locations CPT<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to disable rewriting Front base for Locations CPT.\n *\/\nadd_filter( 'rank_math\/locations\/front', '__return_false'  );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-seo-filters-from-posts\">49. Filter to remove SEO filters from posts<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove SEO Filters from Posts.\n *\n * @param array $options    SEO Filter options.\n * @param string $post_type Post type.\n *\n * @param array\/bool Filtered options\n *\/\nadd_filter( 'rank_math\/manage_posts\/seo_filter_options', '__return_false' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-lock-modified-date\">50. Filter to Remove Lock Modified Date option<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove the lock modified date option\n *\/\nadd_filter( 'rank_math\/lock_modified_date', '__return_false' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"enable-gtin-field\">51. Filter to Enable Rank Math GTIN Field<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to enable Rank Math GTIN field.\n *\/\nadd_filter( 'rank_math\/woocommerce\/add_gtin_field', '__return_true' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-search-intent-analysis\">52. Filter to Disable Search Intent Analysis Feature<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to disable Search Intent Analysis feature.\n *\/\nadd_filter( 'rank_math\/determine_search_intent', '__return_false' );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"sitemap\">mapa del sitio<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-sitemap-base\">1. Filter to change the Sitemap URL Base<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the Sitemap URL Base\n *\n * @param string $base New URL Base\n *\/\nadd_filter( 'rank_math\/sitemap\/base_url', function( $base ){\n\treturn 'search-sitemaps\/';\n}, 10, 1 );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-sitemap-cache-folder\">2. Filter to change the Sitemap Cache directory.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter XML sitemap cache directory.\n *\n * @param string $unsigned Default cache directory\n *\/\nadd_filter( 'rank_math\/sitemap\/cache_directory', function( $directory) {\n\treturn $directory;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"enable-disable-sitemap-cache\">3. Filter to enable\/disable Sitemap caching.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter if XML sitemap transient cache is enabled.\n *\n * @param boolean $unsigned Enable cache or not, defaults to true\n *\/\nadd_filter( 'rank_math\/sitemap\/enable_caching', '__return_true');\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-sitemap-caching-mode\">4. Filter to change Sitemap caching mode.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change sitemap caching mode\n * \n * @param string $mode  Cache mode \"file\" or \"db\".\n *\/\nadd_filter( 'rank_math\/sitemap\/cache_mode', function( $mode ) {\n\treturn $mode;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exclude-post-type-fro-sitemap\">5. Filter to exclude post type from the Sitemap.<\/h3>\n\n\n\n<p>This filter will override the&nbsp;<a href=\"https:\/\/rankmath.com\/kb\/configure-sitemaps\/#include-in-sitemap\">Incluir en el mapa del sitio<\/a>&nbsp;option available under&nbsp;<strong>Rank Math SEO \u2192 Sitemap Settings \u2192 Post Types<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter decision if post type is excluded from the XML sitemap.\n *\n * @param bool   $exclude Default false.\n * @param string $type    Post type name.\n *\/\nadd_filter( 'rank_math\/sitemap\/exclude_post_type', function( $exclude, $type ){\n\treturn $exclude;\n}, 10, 2 );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"filter-sitemap-item\">6. Filter sitemap item before it gets added to the sitemap.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter URL entry before it gets added to the sitemap.\n *\n * @param array  $url  Array of URL parts.\n * @param string $type URL type. Can be user, post or term.\n * @param object $object Data object for the URL.\n *\/\nadd_filter( 'rank_math\/sitemap\/entry', function( $url, $type, $object ){\n\treturn $url;\n}, 10, 3 );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-remove-archive-url\">7. Filter to change\/remove archive url, plugin uses in the XML Sitemap.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter the URL Rank Math SEO uses in the XML sitemap for this post type archive.\n *\n * @param string $archive_url The URL of this archive\n * @param string $post_type   The post type this archive is for.\n *\/\nadd_filter( 'rank_math\/sitemap\/post_type_archive_link', function( $archive_url, $post_type ){\n\treturn $archive_url;\n}, 10, 2 );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-remove-post-url\">8. Filter to change\/remove Post URL, plugin uses in the sitemap.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter the URL Rank Math SEO uses in the XML sitemap.\n *\n * Note that only absolute local URLs are allowed as the check after this removes external URLs.\n *\n * @param string $url  URL to use in the XML sitemap\n * @param object $post Post object for the URL.\n *\/\nadd_filter( 'rank_math\/sitemap\/xml_post_url', function( $url, $post){\n\treturn $url;\n}, 10, 2 );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exclude-taxonomy-from-sitemap\">9. Filter to exclude taxonomy from Sitemap.<\/h3>\n\n\n\n<p>This filter will override the&nbsp;<a href=\"https:\/\/rankmath.com\/kb\/configure-sitemaps\/#include-in-sitemap-8\">Incluir en el mapa del sitio<\/a>&nbsp;option available under&nbsp;<strong>Rank Math SEO \u2192<\/strong> <strong>Sitemap Settings \u2192 Taxonomies<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter decision if taxonomy is excluded from the XML sitemap.\n *\n * @param bool   $exclude Default false.\n * @param string $type    Taxonomy name.\n *\/\nadd_filter( 'rank_math\/sitemap\/exclude_taxonomy', function( $exclude, $type ){\n\treturn $exclude;\n}, 10, 2 );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exclude-empty-terms-from-sitemap\">10. Filter to exclude empty terms from Sitemap.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter the setting of excluding empty terms from the XML sitemap.\n *\n * @param boolean $exclude        Defaults to true.\n * @param array   $taxonomy_names Array of names for the taxonomies being processed.\n *\/\nadd_filter( 'rank_math\/sitemap\/exclude_empty_terms', function( $exclude , $taxonomy_names ){\n\treturn $exclude;\n}, 10, 2 );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-change-images\">11. Filter to remove\/change images included for the post in XML sitemap.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter images to be included for the post in XML sitemap.\n *\n * @param array $images  Array of image items.\n * @param int   $post_id ID of the post.\n *\/\nadd_filter( 'rank_math\/sitemap\/urlimages', function( $images, $post_id ){\n\treturn $images;\n}, 10, 2);\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sitemap-credit\">12. Filter to Remove Sitemap credit.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove sitemap credit.\n *\n * @param boolean Defaults to false.\n *\/\nadd_filter( 'rank_math\/sitemap\/remove_credit', '__return_true');\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-extra-urls-in-sitemap\">13. Filter to Add Extra URLs in the Sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n Filter to add extra URLs to the XML sitemap by type.\n *\n Only runs for the first page, not on all.\n *\n @param string $content String content to add, defaults to empty.\n *\/\nadd_action( 'rank_math\/sitemap\/{$type}_content', function() {\nreturn '&lt;url&gt;\n&lt;loc&gt;https:\/\/rankmath.com\/some-custom-url\/&lt;\/loc&gt;\n&lt;lastmod&gt;2020-06-10T20:20:20+00:00&lt;\/lastmod&gt;\n&lt;\/url&gt;';\n});<\/code><\/pre>\n\n\n\n<p>Replace <code>{$type}<\/code> with either <code>correo<\/code> o <code>p\u00e1gina<\/code> depending on if you want the URL to be included in the post or page sitemap &#8211; respectively.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sitemap-remove-locations-kml\">14. Filter to add Locations KML file in the Sitemap<\/h3>\n\n\n\n<p>The below filter enables you to add the Locations KML file to your sitemap. But please note, the KML file will be added only if you have <a href=\"https:\/\/rankmath.com\/kb\/kml-sitemap\/#add-kml-for-local-business\">added your business geocoordinates<\/a> in Rank Math&#8217;s Local SEO settings.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add Locations KML file in the sitemap\n *\/\nadd_filter( 'rank_math\/sitemap\/locations', '__return_true' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sitemap-cdn-urls\">15. Filter to Add CDN Image URLs in the Sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to Add CDN Image URLs in the Sitemap\n *\n * @param string $src  Image URL.\n * @param object $post Post object.\n *\/\nadd_filter( 'rank_math\/sitemap\/xml_img_src', function( $src, $post ){\n\t$src = str_replace( 'http:\/\/domain.com', 'https:\/\/cdn.domain.com', $src );\n\treturn $src;\n}, 10, 2);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sitemap-url-for-search-console\">16. Filter to detect third party sitemap URL in the Search Console<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to detect Sitemap URL in the Search Console if you are using different plugin for sitemap.\n *\/\nadd_filter( 'rank_math\/sitemap\/sitemap_index_uri', function() { return 'sitemap.xml'; } );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sitemap-user-query\">17. Filter to change user query arguments for the sitemap listing<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change user query arguments for the sitemap listing\n *\/\nadd_filter( 'rank_math\/sitemap\/author\/query', function( $args ) {\n\t$args&#091;'role__not_in'] = 'subscriber'; return $args;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"show-noindexed-urls-in-the-sitemap\">18. Filter to add `noindex` URLs in the Sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n* Filter to add `noindex` URLs in the Sitemap\n*\n* @param bool $value Whether to include noindex terms in Sitemap.\n* @param string $type Object Type.\n*\n* @return boolean\n*\/\nadd_filter( 'rank_math\/sitemap\/include_noindex', function( $value, $type ) {\n\treturn true;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-external-sitemap\">19. Filter to add external Sitemap to the&nbsp;Rank Math&nbsp;Sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'rank_math\/sitemap\/index', function( $xml ) {\n\t$xml .= '\n\t\t&lt;sitemap&gt;\n\t\t\t&lt;loc&gt;http:\/\/example.com\/new-sitemap.xml&lt;\/loc&gt;\n\t\t\t&lt;lastmod&gt;2020-09-14T20:34:15+00:00&lt;\/lastmod&gt;\n\t\t&lt;\/sitemap&gt;';\n\t\treturn $xml;\n}, 11 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-content-to-new-sitemap\">20. Filter to add content in the new sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add links in the new Sitemap.\n *\/\nadd_filter( 'rank_math\/sitemap\/{$type}\/content', function() {\n\treturn '\n\t\t&lt;urlset xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;\n\t\t\t&lt;url&gt;\n\t\t\t\t&lt;loc&gt;http:\/\/example.com\/new-sitemap-post\/&lt;\/loc&gt;\n\t\t\t\t&lt;lastmod&gt;2020-09-14T20:34:15+00:00&lt;\/lastmod&gt;\n\t\t\t&lt;\/url&gt;\n\t\t&lt;\/urlset&gt;';\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sitemap-headers\">21. Filter the sitemap HTTP headers<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter the sitemap HTTP headers.\n *\n * @param array $headers HTTP headers.\n * @param bool  $is_xsl Whether these headers are for XSL.\n *\/\nadd_filter( 'rank_math\/sitemap\/http_headers', function( $headers ) {\n\tif ( '\/locations.kml' !== $_SERVER&#091;'REQUEST_URI'] ) {\n\t\treturn $headers;\n\t}\n\tunset( $headers&#091;'X-Robots-Tag'] );\n\treturn $headers;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-post-content-before-passing-image-parser\">22. Change the post content before passing it to the Image Parser<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: 'rank_math\/sitemap\/content_before_parse_html_images' - Filters the post content\n * before it is parsed for images.\n *\n * @param string $content The raw\/unprocessed post content.\n * @param int    $post_id The current Post ID.\n *\/\nadd_filter( 'rank_math\/sitemap\/content_before_parse_html_images', function( $content, $post_id ) {\n    \/\/ Process content..\n    return $content;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-html-sitemap-sort-order\">23. Filter to change the sort order in the HTML Sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: 'rank_math\/sitemap\/html_sitemap\/sort_items' - Allow changing the sort order of the HTML sitemap.\n *\n * @var array $sort {\n *    @type string $field The field to sort by.\n *    @type string $order The sort order.\n * }\n * @var string $type     The item type.\n * @var string $name     The post type\/taxonomy name.\n *\/\nadd_filter('rank_math\/sitemap\/html_sitemap\/sort_items', function ($sort, $type, $name) {\n    return $sort;\n}, 10, 3);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-html-sitemap-post-statuses\">24. Filter to change the post statuses to be included in the HTML Sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: 'rank_math\/sitemap\/html_sitemap_post_statuses' - Allow changing the post statuses that should be included in the HTML sitemap.\n *\n * @var array  $statuses Post statuses.\n * @var string $post_type Post type name.\n *\/\nadd_filter('rank_math\/sitemap\/html_sitemap_post_statuses', function ($statuses, $post_type) {\n    return $statuses;\n}, 10, 2);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-html-sitemap-post-types\">25. Filter to change the post types to be included in the HTML Sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: 'rank_math\/sitemap\/html_sitemap_post_types' - Allow changing the post types to be included in the HTML sitemap.\n *\n * @var array $post_types The post types to be included in the HTML sitemap.\n *\/\nadd_filter('rank_math\/sitemap\/html_sitemap_post_types', function ($post_types) {\n    return $post_types;\n}, 10, 1);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-html-sitemap-taxonomies\">26. Filter to change the taxonomies to be included in the HTML Sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: 'rank_math\/sitemap\/html_sitemap_taxonomies' - Allow changing the taxonomies to be included in the HTML sitemap.\n *\n * @var array $taxonomies The taxonomies to be included in the HTML sitemap.\n *\/\nadd_filter('rank_math\/sitemap\/html_sitemap_taxonomies', function ($taxonomies) {\n    return $taxonomies;\n}, 10, 1);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-html-sitemap-tab\">27. Filter to remove the HTML Sitemap tab from Sitemap Settings<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove HTML sitemap tab from the Sitemap settings.\n *\n * @param array $tabs\n *\/\nadd_filter( 'rank_math\/settings\/sitemap', function( $tabs) {\n\tif ( isset( $tabs&#091;'html_sitemap'] ) ) {\n\t\tunset( $tabs&#091;'html_sitemap'] );\n\t}\n\n\treturn $tabs;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-video-content-thumbnail-location\">28. Filter to change video content and thumbnail location<\/h3>\n\n\n\n<p>In the below filter, replace <code>{$prop}<\/code> con <code>thumbnail_loc<\/code> to change the thumbnail location and <code>content_loc<\/code> to change the content location<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter the video content and thumbnail location:\n * - rank_math\/sitemap\/video\/thumbnail_loc\n * - rank_math\/sitemap\/video\/content_loc\n *\/\nadd_filter(\"rank_math\/sitemap\/video\/{$prop}\", function ($loc) {\n\treturn $loc;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-lastmod-in-sitemap\">29. Filter to remove the Last Modified Column from Sitemap Index<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove lastmod from sitemap index\n *\/\nadd_filter( 'rank_math\/sitemap\/index\/entry', function( $index, $type ) {\n    if ( isset( $index&#091;'lastmod'] ) ) {\n\t\tunset( $index&#091;'lastmod'] );\n\t}\n\treturn $index;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<p>To remove the Last Modified columns from specific sitemaps in the index, the filter can be used as<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove lastmod from sitemap\n *\/\nadd_filter( 'rank_math\/sitemap\/index\/entry', function( $index, $type ) {\n    if ( 'term' === $type ) {\n        return $index;\n    }\n\n    if ( isset( $index&#091;'lastmod'] ) ) {\n\t\tunset( $index&#091;'lastmod'] );\n\t}\n\treturn $index;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<p class=\"takeaway yellow\"><strong>Nota:<\/strong> Please be sure to flush the sitemap cache as shown <a href=\"https:\/\/rankmath.com\/kb\/sitemap-404-error\/#sitemap-cache\">in this tutorial<\/a> for these changes to reflect on the front end.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"modify-post-object-in-sitemap\">30. Filter to modify the post object added to the Sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter the post object before it gets added to the sitemap.\n * This allows you to add custom properties to the post object,\n * or replace it entirely.\n * \n * @param object $post Post object.\n *\/\nadd_filter('rank_math\/sitemap\/post_object', function($post){\n    return $post;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"modify-sitemap-index-slug\">31. Filter to modify the Sitemap Index slug<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: 'rank_math\/sitemap\/index_slug' - Modify the sitemap index slug.\n *\n * @param string $slug Sitemap index slug.\n *\n * @return string\n *\/\nadd_filter( 'rank_math\/sitemap\/index\/slug', function($slug) {\n\treturn $slug;\n});<\/code><\/pre>\n\n\n\n<p class=\"takeaway yellow\"><strong>Nota:<\/strong> If you have updated the Sitemap Index slug using the above filter, then head over to <strong>Settings \u2192 Permalinks<\/strong> in your WordPress dashboard and click the <strong>Guardar cambios<\/strong> button for the changes to reflect.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-sitemap-slug\">32. Filter to change Sitemap Slug<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter the slug of the author sitemap.\n *\n * @param string $slug Slug of the author sitemap.\n *\/\nadd_filter( 'rank_math\/sitemap\/author\/slug', function($slug){\n\treturn 'author'; \/\/Change this to your preferred slug.\n});<\/code><\/pre>\n\n\n\n<p>Similarly, the bellow filters can be used for changing the slug of video sitemap and news sitemap.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'rank_math\/sitemap\/video\/slug', function( $slug ) {\n    return 'video'; \/\/Change this slug.\n});\n\nadd_filter( 'rank_math\/sitemap\/news\/slug', function( $slug ) {\n    return 'news'; \/\/Change this slug.\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-language-news-sitemap\">33. Filter to modify the value of <code>&lt;news:language&gt;<\/code> in News Sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: 'rank_math\/sitemap\/news\/language' - Allow changing the news language based on the entity.\n *\n * @param string $lang   Language code.\n * @param array  $entity Array of parts that make up this entry.\n *\/\nadd_filter( 'rank_math\/sitemap\/news\/language', function( $lang, $entity ) {\n\treturn $lang;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-content-video-parser\">34. Filter to change the content passed to the Auto-Detect Video Parser<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the content passed to the Video Parser.\n *\n * @param string $content Post Content.\n * @param object $post    Post Object.\n *\n * @return string Content.\n *\/\nadd_filter('rank_math\/video\/parser_content', function( $content, $post ) {\n\treturn $content;\n}, 10, 2);<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exclude-stock-status-sitemap\">35. Filter to exclude products with specific stock status from Sitemap <a href=\"https:\/\/rankmath.com\/es\/pricing\/\" class=\"pro-badge\" target=\"_blank\" style=\"vertical-align:\" title=\"Plan Premium Rank Math\"><span class=\"label\">PRO<\/span><\/a><\/h3>\n\n\n\n<p>Use this filter to select the stock status of products you want to be included in your sitemap. You can also exclude specific stock statuses, such as &#8220;Out of Stock&#8221; products. <\/p>\n\n\n\n<p class=\"takeaway yellow\"><strong>Nota:<\/strong> This filter is available only for Rank Math PRO users.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>**\n * Filter to exclude specific stock status from sitemap\n *\/\nadd_filter( 'rank_math\/woocommerce\/stock_status', function( $statuses ) {\n    return &#091; 'instock', 'onbackorder' ]; \/\/ outofstock is excluded\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"where-clause-html-sitemap\">36. Filter to add a WHERE clause to the HTML Sitemap query<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add a WHERE clause for the HTML sitemap get_posts(type, post_parent&#091;] ) query.\n *\n * @param string $where      SQL WHERE query, defaults to an empty string.\n * @param array  $post_type  The Post type.\n *\/\nadd_filter('rank_math\/html_sitemap\/get_posts\/where',function($where, $post_type){\n    return $where;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"join-clause-html-sitemap\">37. Filter to add a JOIN clause to the HTML Sitemap query<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add a JOIN clause for the HTML get_posts(type, post_parent&#091;]) query.\n *\n * @param string $join       SQL join clause, defaults to an empty string.\n * @param array  $post_type  The Post type.\n *\/\nadd_filter('rank_math\/html_sitemap\/get_posts\/join',function($join, $post_type){\n    return $join;\n});\t<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"html-sitemap-post-limit\">38. Filter to Increase the Post Limit in HTML Sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to increase the post limit for HTML sitemap\n *\n * @param int $post_limit post limit\n *\/\nadd_filter( 'rank_math\/sitemap\/html_sitemap_post_limit', function( $post_limit) {\n\treturn 1000; \/\/ Default limit set to 1000 posts\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exclude-canonicals-from-sitemap\">39. Filter to Exclude Posts with Canonical URLs in the Sitemap<\/h3>\n\n\n\n<p>By default, posts with custom canonical URLs (especially external ones) are <em>included<\/em> en el mapa del sitio <strong>post count query<\/strong> but are later <em>excluded<\/em> desde el <strong>sitemap output<\/strong>.<\/p>\n\n\n\n<p>When this filter is enabled (<code>verdadero<\/code>), it <strong>excludes posts with any custom canonical URL<\/strong> (including self-referencing ones) from the <strong>post count query<\/strong> itself, preventing empty sitemap pages.<\/p>\n\n\n\n<p class=\"takeaway yellow\">Please use this filter only if you&#8217;re seeing 404 sitemap pages and use external canonical URLs.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to exclude posts with canonical URLs from the sitemap.\n *\n * @param bool         $exclude Whether to exclude posts with canonical URLs.\n * @param array|string $post_types The post types being queried.\n *\/\nadd_filter( 'rank_math\/sitemap\/exlude_posts_with_canonical_urls', function( $exclude, $post_types ) {\n\treturn true;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"term-exclusion-news-sitemap\">40. Filter to decide strict term exclusion for news sitemap<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter whether to use strict term exclusion for the news sitemap.\n *\n * @param bool   $strict Whether to use strict exclusion. Default true.\n * @param string $key    Taxonomy key being processed.\n * @param array  $terms  Excluded terms grouped by taxonomy.\n *\/\nadd_filter( 'rank_math\/sitemap\/news\/use_all_terms_for_exclude_check', function( $strict, $key, $terms ) {\n\treturn $strict;\n}, 10, 3 );\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"podcast\">Podcast<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prevent-podcast-data-wp-feeds\">1. <strong>Filter to prevent adding podcast data to the WP feeds.<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to prevent adding podcast data in the WP feeds.\n *\/\nadd_filter( 'rank_math\/podcast\/enhance_all_feeds', '__return_false' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-podcast-feed-namespace\">2. <strong>Filter to remove the Podcast feed namespace.<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove the Podcast feed namespace.\n *\/\nadd_filter( 'rank_math\/rss\/add_podcasts_namespace', '__return_false' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"modify-hub-urls\">3. <strong>Filter to modify the Hub URLs.<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to modify the hub URLs.\n * \n * @param array $urls The HUB URLs.\n *\/\nadd_filter( 'rank_mathpodcast\/hub_urls', function( $urls ) {\n\treturn $urls\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prevent-auto-publish-feed-pubhubsubbub\">4. <strong>Filter to prevent Rank Math from automatically publishing feed to Pubhubsubbub.<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to prevent Rank Math from automatically publishing feed to Pubhubsubbub.\n * \n * @param array $urls The HUB URLs.\n *\/\nadd_filter( 'rank_math\/podcast\/hub_urls', '__return_false' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-user-agent-pubhubsubbub\">5. <strong>Filter to change the User-agent used to publish the feed to Pubhubsubbub.<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the User-agent used to publish the feed to Pubhubsubbub.\n * \n * @param string $user_agent The user agent.\n *\/\nadd_filter( 'rank_math\/podcast\/useragent', function( $user_agent ) {\n\treturn $user_agent;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-podcast-episode-title\">6. Filter to Change the Title of the Podcast Episode<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: 'rank_math\/schema\/podcast_episode_title' - Allow changing the title of the podcast episode. Pass false to disable.\n *\n * @var string $episode_title The title of the podcast episode.\n *\n * @param WP_Post $post   The post object.\n * @param array   $schema The schema array.\n *\/\nadd_filter('rank_math\/schema\/podcast_episode_title', function( $episode_title, $post, $schema ) {\n\treturn $episode_title;\n}, 10, 3);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"modify-podcast-rss-feed\">7. Filter to change the number of Podcast Episodes in the RSS Feed<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the podcast feed arguments\n *\/\nadd_filter( 'rank_math\/podcast_args', function( $args = &#091;] ) {\n    $args&#091; 'posts_per_page' ] = 5;\n    return $args;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"podcast-rss-feed-permalink\">8. Filter to modify Podcast RSS feed permalink<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to modify the permalink of Podcast RSS feed.\n * \n * @pram string $podcast Podcast RSS feed slug.\n *\/\nadd_filter( 'rank_math\/podcast\/feed', function( $podcast ) {\n    return 'new-podcast';\n});<\/code><\/pre>\n\n\n\n<p class=\"takeaway yellow\"><strong>Nota:<\/strong> Once you have modified the Podcast feed slug using the above filter, head over to <strong>Settings \u2192 Permalinks<\/strong> in your WordPress dashboard and click the <strong>Guardar cambios<\/strong> button for the changes to reflect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"breadcrumbs\">Migas de pan<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-breadcrumb-settings\">1. Filter to change the Breadcrumb Settings.<\/h3>\n\n\n\n<p>The filter will override the <a href=\"https:\/\/rankmath.com\/kb\/general-settings\/#breadcrumbs\">breadcrumb options<\/a> selected by the user under&nbsp;<strong>Rank Math SEO \u2192 General Settings \u2192 Breadcrumbs<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change breadcrumb settings.\n *\n * @param  array $settings Breadcrumb Settings.\n * @return array $setting.\n *\/\nadd_filter( 'rank_math\/frontend\/breadcrumb\/settings', function( $settings ) {\n\t$settings = array(\n\t\t'home'           =&gt; true,\n\t\t'separator'      =&gt; '',\n\t\t'remove_title'   =&gt; '',\n\t\t'hide_tax_name'  =&gt; '',\n\t\t'show_ancestors' =&gt; '',\n\t);\n\treturn $settings;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-breadcrumb-strings\">2. Filter to change Breadcrumb Strings.<\/h3>\n\n\n\n<p>The filter will override the breadcrumbs strings selected by the user under&nbsp;<strong>Rank Math SEO \u2192<\/strong> <strong>General Settings \u2192 Breadcrumbs<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change breadcrumb strings.\n *\n * @param  array $settings Breadcrumb Strings.\n * @return array $strings.\n *\/\nadd_filter( 'rank_math\/frontend\/breadcrumb\/strings', function( $strings ) {\n\t$strings = array(\n\t\t'prefix'         =&gt; '',\n\t\t'home'           =&gt; '',\n\t\t'error404'       =&gt; '',\n\t\t'archive_format' =&gt; '',\n\t\t'search_format'  =&gt; '',\n\t);\n\treturn $strings;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-breadcrumb-args\">3. Filter to change Breadcrumb args.<\/h3>\n\n\n\n<p>This filter allows you to change the breadcrumb arguments and the breadcrumb appearance on the front-end as well.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change breadcrumb args.\n *\n * @param  array $args Breadcrumb args.\n * @return array $args.\n *\/\nadd_filter( 'rank_math\/frontend\/breadcrumb\/args', function( $args ) {\n\t$args = array(\n\t\t'delimiter'   =&gt; '&amp;nbsp;\/&amp;nbsp;',\n\t\t'wrap_before' =&gt; '&lt;nav class=&quot;rank-math-breadcrumb&quot;&gt;&lt;p&gt;',\n\t\t'wrap_after'  =&gt; '&lt;\/p&gt;&lt;\/nav&gt;',\n\t\t'before'      =&gt; '',\n\t\t'after'       =&gt; '',\n\t);\n\treturn $args;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-breadcrumb-html\">4. Filter to change the Breadcrumb HTML.<\/h3>\n\n\n\n<p>This filter allows you to make any changes to the Breadcrumb HTML on the front-end.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change breadcrumb html.\n *\n * @param  html  $html Breadcrumb html.\n * @param  array $crumbs Breadcrumb items\n * @param  class $class Breadcrumb class\n * @return html  $html.\n *\/\nadd_filter( 'rank_math\/frontend\/breadcrumb\/html', function( $html, $crumbs, $class ) {\n\t\/\/ theme_breadcrumb_function();\n\treturn $html;\n}, 10, 3);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-primary-term-output\">5. Filter to change the primary term output of the breadcrumbs class.<\/h3>\n\n\n\n<p>You can use this filter to&nbsp;<a href=\"https:\/\/rankmath.com\/kb\/how-to-choose-a-primary-category\/\">change the primary term<\/a>&nbsp;output of the breadcrumbs class dynamically on the front-end.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the primary term output of the breadcrumbs class.\n *\n * @param WP_Term $term  Primary term.\n * @param array   $terms Terms attached to the current post.\n *\/\nadd_filter( 'rank_math\/frontend\/breadcrumb\/main_term', function( $current_term, $terms ) {\n\treturn $current_term;\n}, 10, 2 );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-remove-breadcrumb-items\">6. Filter to change\/remove breadcrumb items.<\/h3>\n\n\n\n<p>This filter allows developers to make any changes or remove any breadcrumb items dynamically on the front-end. When you change\/remove the breadcrumb item with this filter, the changes will also reflect in the Breadcrumb Schema.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow changing or removing the Breadcrumb items\n *\n * @param array       $crumbs The crumbs array.\n * @param Breadcrumbs $this   Current breadcrumb object.\n *\/\nadd_filter( 'rank_math\/frontend\/breadcrumb\/items', function( $crumbs, $class ) {\n\treturn $crumbs;\n}, 10, 2);\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-remove-items-from-breadcrumb-snippet\">7. Filter to change\/remove breadcrumb items from Breadcrumb Snippet.<\/h3>\n\n\n\n<p>The changes made using this filter will affect&nbsp;<em>solamente<\/em>&nbsp;the Breadcrumb Schema.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow changing Breadcrumb elements in BreadcrumbList snippet\n *\n * @param array $entity Breadcrumb entity\n *\/\nadd_filter( 'rank_math\/snippet\/breadcrumb', function( $entity ) {\n\treturn $entity;\n});\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"metadata\">Meta Data<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-the-title\">1. Filter to change the Title.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the page title.\n * \n * @param string $title\n *\/\nadd_filter( 'rank_math\/frontend\/title', function( $title ) {\n\treturn $title;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"move-title-inside-metabox\">2. The code to move the title inside the Rank Math&#8217;s meta box<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Code to move title inside the Rank Math's meta\n * \n * @param string $title\n *\/\nadd_action( 'init', function() {\n    add_action( 'rank_math\/head', '_block_template_render_title_tag' );\n});\n\nadd_action( 'wp_before_include_template', function() {\n    remove_action( 'wp_head', '_block_template_render_title_tag', 1 );\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-meta-description\">3. Filter to change the meta description.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow changing the meta description sentence from within the theme.\n *\n * @param string $description The description sentence.\n *\/\nadd_filter( 'rank_math\/frontend\/description', function( $description ) {\n\treturn $description;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"use-global-meta-description\">4. Use the Description from Global Setting, if the description is missing in the Post metabox:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Use the Description from Global Setting, if the description is missing in the Post metabox\n *\/\nadd_action( 'rank_math\/frontend\/description', function( $description ) {\n global $post;\n $desc = RankMath\\Post::get_meta( 'description', $post-&gt;ID );\n\n if ( ! $desc ) {\n $desc = RankMath\\Helper::get_settings( \"titles.pt_{$post-&gt;post_type}_description\" );\n if ( $desc ) {\n return RankMath\\Helper::replace_vars( $desc, $post );\n }\n }\n\n return $description;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-robots-meta\">5. Filter to change robots data.<\/h3>\n\n\n\n<p>Use this filter to change robots meta added by Rank Math dynamically on the front-end.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allows filtering of the robots meta data.\n *\n * @param array $robots The meta robots directives.\n *\/\nadd_filter( 'rank_math\/frontend\/robots', function( $robots ) {\n\treturn $robots;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-canonical-url\">6. Filter to change Canonical URL.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow changing of the canonical URL.\n *\n * @param string $canonical The canonical URL.\n *\/\nadd_filter( 'rank_math\/frontend\/canonical', function( $canonical ) {\n\treturn $canonical;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-plugin-credit-notice\">7. Filter to remove plugin credit notice added to the page source.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove the plugin credit notice added to the source.\n *\n *\/\nadd_filter( 'rank_math\/frontend\/remove_credit_notice', '__return_true' );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-adjacent-lins\">8. Filter to disable adjacent links ( next\/prev ).<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allows developers to handle rel=\"next\" \/ rel=\"prev\" by themselves.\n *\n * @param bool $links_generated Whether or not to handle rel=\"next\" \/ rel=\"prev\" links.\n *\/\nadd_filter( 'rank_math\/frontend\/disable_adjacent_rel_links', '__return_true' );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-adjacent-link-output\">9. Filter to change adjacent link output.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow the changing of link rel output by Rank Math.\n *\n * @param string $link The full `&lt;link` element.\n * $rel can be next or prev\n *\/\nadd_filter( \"rank_math\/frontend\/{$rel}_rel_link\", function( $link ) {\n return $link;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-keywords-meta-tag\">10. Filter to add the Keywords meta tag<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Add &lt;meta name=\"keywords\" content=\"focus keywords\"&gt;.\n *\/\nadd_filter( 'rank_math\/frontend\/show_keywords', '__return_true');<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-meta-keywords\">11. Filter to change the meta keywords<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow changing the meta keywords from the default Focus Keywords.\n *\n * @param string $keywords Keywords.\n *\/\nadd_filter( 'rank_math\/frontend\/keywords', function( $keywords ) {\n return $keywords;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"allow-shortcodes\">12. Filter to Allow Shortcodes in the Meta Data<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow shortcodes in the Meta Data.\n *\/\nadd_filter( 'rank_math\/paper\/auto_generated_description\/apply_shortcode', '__return_true' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"allow-shortcodes-in-product-description\">13. Filter to allow shortcodes in the Product Schema description<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n* Filter to allow shortcodes in the Product schema description.\n*\/\nadd_filter( 'rank_math\/product_description\/apply_shortcode', '__return_true' );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"opengraph\">OpenGraph<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-opengraph-type\">1. Filter to change OpenGraph Type ( og:type ).<\/h3>\n\n\n\n<p>Use this filter to change the OpenGraph type for the specific page on the front-end.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/** * Permite a los desarrolladores de temas cambiar el tipo OpenGraph de la p\u00e1gina. * * @param string $type La cadena de tipo OpenGraph. *\/ add_filter( &#039;rank_math\/opengraph\/type&#039;, function( $type ) { return $type; });\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-opengraph-url\">2. Filter to change OpenGraph URL ( og:url ).<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allows the output of the canonical URL as OpenGraph URL, consolidating likes and shares.\n *\n * @link https:\/\/developers.facebook.com\/docs\/reference\/opengraph\/object-type\/article\/\n * @param $url Canonical URL\n *\/\nadd_filter( 'rank_math\/opengraph\/url', function( $url ) {\n\treturn $url;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-twitter-tags\">3. Filter to remove Twitter tags from page output.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allows changing the Twitter Card type as output in the Twitter card.\n *\n * @param string $type\n *\/\nadd_filter( 'rank_math\/opengraph\/twitter_card', '__return_false' );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-opengraph-image\">4. Filter to change OpenGraph Image.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allows developers to change the OpenGraph image within theme.\n *\n * The dynamic part of the hook name. $network, is the network slug. Can be facebook or twitter.\n *\n * @param string $attachment_url The image we are about to add.\n *\/\nadd_filter( \"rank_math\/opengraph\/{$network}\/image\", function( $attachment_url ) {\n\treturn $attachment_url;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-images-og-tags\">5. Filter to allow developers to add additional images.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allows developers to add images to the OpenGraph tags within the theme.\n *\n * The dynamic part of the hook name. $network, is the network slug. Can be facebook or twitter.\n *\n * @param Image The current object.\n *\/\nadd_filter( 'rank_math\/opengraph\/{$network}\/add_additional_images', function( $image ) {\n\treturn $image;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prevent-default-image-og\">6. Filter to prevent setting default image in OpenGraph.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Passing a truthy value to the filter will effectively short-circuit the\n * set default image process.\n *\n * @param bool $return Short-circuit return value. Either false or true.\n *\/\nadd_filter( 'rank_math\/opengraph\/pre_set_default_image', '__return_true' );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prevent-image-setting-og\">7. Filter to prevent setting image from content when image is not added in OpenGraph.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Passing a truthy value to the filter will effectively short-circuit the\n * set content image process.\n *\n * @param bool $return  Short-circuit return value. Either false or true.\n * @param int  $post_id Post ID for the current post.\n *\/\nadd_filter( 'rank_math\/opengraph\/pre_set_content_image', function( $return, $post_id ) {\n\treturn $return; \/\/ Set to true if you don't want to set image from Content.\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"determine-image-size\">8. Filter to determine image size to show in og:image, twitter:image.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Determines which image sizes we'll loop through to get an appropriate image.\n *\n * @param unsigned array - The array of image sizes to loop through. Default array( 'full', 'large', 'medium_large' )\n *\/\nadd_filter( 'rank_math\/opengraph\/image_sizes', function( $sizes ) {\n\treturn $sizes;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-specific-social-meta\">9. Filter to change specific social meta tags.<\/h3>\n\n\n\n<p>This filter lets you change specific social meta tags dynamically on the front-end.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to change the content of specific social meta tags.\n *\n * The dynamic part of the hook name. $network, is the network slug\n * and $og_property, is the property which we are outputting.\n *\n * @param string $content The content of the property.\n *\/\nadd_filter( \"rank_math\/opengraph\/{$network}\/$og_property\", function( $content ) {\n\treturn $content;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-twitter-card-type\">10. Filter to change twitter card type.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow changing the Twitter Card type as output in the Twitter card.\n *\n * @param string $type\n *\/\nadd_filter( 'rank_math\/opengraph\/twitter\/card_type', function( $type ) {\n\treturn $type;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-opengraph-tags\">11. A Hook to remove OpenGraph tags.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Hook to remove og:tags\n *\/\nadd_action( 'rank_math\/head', function() {\n\tremove_all_actions( 'rank_math\/opengraph\/facebook' );\n\tremove_all_actions( 'rank_math\/opengraph\/twitter' );\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prevent-price-output\">12. Prevent the Output of the Price<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to prevent the output of the price in the OpenGraph tags.\n *\n * @param bool unsigned Defaults to true.\n *\/\nadd_filter( 'rank_math\/woocommerce\/og_price', '__return_false' );<\/code><\/pre>\n\n\n\n<p>Use this filter to remove the&nbsp;<code>producto:precio:cantidad<\/code>&nbsp;&amp;&nbsp;<code>producto:precio:moneda<\/code>&nbsp;meta tags.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-time-to-read-text\">13. Change Text to Calculate the Time to Read<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: Change the text to calculate the time to read.\n * \n * @param string $content The content of the post.\n *\/\nadd_filter('rank_math\/frontend\/time_to_read_content', function ($post_content) {\n    return wp_strip_all_tags($post_content);\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-words-per-minute\">14. Change the Words Per Minute to Calculate the Time to Read<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: Change the words per minute to calculate the time to read.\n *\/\nadd_filter( 'rank_math\/frontend\/time_to_read_wpm', function(){\n    return 200; \/\/Words Per Minute\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"update-overlay-image\">15. Filter to Allow CDN Path in the Overlay Image<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: 'rank_math\/social\/create_overlay_image' - Change the create_overlay_image arguments.\n *\/\nadd_filter('rank_math\/social\/create_overlay_image', function ($args) {\n\treturn $args;\n}, 10, 1);<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"richsnippets\">Fragmentos enriquecidos<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-json-ld-data\">1. Code to remove json+ld data<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Code to remove json+ld data\n * \n *\/\nadd_action( 'rank_math\/head', function() {\n\tglobal $wp_filter;\n\tif ( isset( $wp_filter&#091;\"rank_math\/json_ld\"] ) ) {\n\t\tunset( $wp_filter&#091;\"rank_math\/json_ld\"] );\n\t}\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"extend-json-ld-data\">2. Filter to extend json+ld data<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Collect data to output in JSON-LD.\n *\n * @param array  $unsigned An array of data to output in json-ld.\n * @param JsonLD $unsigned JsonLD instance.\n *\/\nadd_filter( 'rank_math\/json_ld', function( $data, $jsonld ) {\n\treturn &#091;];\n}, 99, 2);\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-breadcrumblist-schema\">3. Filter to remove BreadcrumbList Schema<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developer to disable the breadcrumb json-ld output.\n *\n * @param bool $unsigned Default: true\n *\/\nadd_filter( 'rank_math\/json_ld\/breadcrumbs_enabled', '__return_false' );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-collectionpage-schema\">4. Filter to remove CollectionPage Schema on Taxonomy Pages<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to remove snippet data from Taxonomies.\n *\n * @param bool $unsigned Default: false\n * @param string $unsigned Taxonomy Name\n *\/\nadd_filter( 'rank_math\/snippet\/remove_taxonomy_data', function( $value, $taxonomy ) {\n\treturn $value; \/\/ true or false\n}, 10, 2);\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-review-display\">5. Filter to disable the Review Display on the frontend<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: Allow disabling the review display.\n *\n * @param bool $return true to disable.\n *\/\nadd_filter( 'rank_math\/snippet\/review\/hide_data', '__return_true' );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-review-display-location\">6. Filter to change the Review Display location<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the review display location\n *\n * @param string $location top, bottom, both or custom.\n *\/\nadd_filter( 'rank_math\/snippet\/review\/location', function( $location, $taxonomy ) {\n\treturn $location;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-review-editor-choice-text\">7. Filter to change the Review Editor&#8217;s choice text<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change review editor's choice text\n *\n * @param string $text Default Editor's choice.\n *\/\nadd_filter( 'rank_math\/review\/text', function( $text ) {\n\treturn $text;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-review-snippet-html\">8. Filter to change the Review Snippet HTML<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change review snippet HTML\n *\n * @param string $html.\n *\/\nadd_filter( 'rank_math\/snippet\/html', function( $html ) {\n\treturn $html;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-schema-data-from-posts\">9. Filter to remove Schema Data from Posts<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove Schema Data from Posts.\n * Replace $schema_type with schema name like article, review, etc.\n * @param bool  $value true\/false Default false\n * @param array $parts Post Data\n * @param array $data  Schema Data\n * \n * @return bool\n *\/\nadd_filter( \"rank_math\/snippet\/rich_snippet_{$schema_type}\", function( $value, $parts, $data ) {\n return true;\n}, 10, 3 );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-post-schema-data\">10. Filter to change Post&#8217;s Front-end Schema data<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the schema data.\n * Replace $schema_type with schema name like article, review, etc.\n * @param array $entity Snippet Data\n * @return array\n *\/\nadd_filter( \"rank_math\/snippet\/rich_snippet_{$schema}_entity\", function( $entity ) {\n return $entity;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-brand-name\">11. Add Brand Name for Products<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add Brand Name for Products.\n *\n * @param array $entity Snippet Data\n * @return array\n *\/\nadd_filter( 'rank_math\/snippet\/rich_snippet_product_entity', function( $entity ) {\n    $entity&#091;'brand']&#091;'@type'] = 'Brand';    \n    $entity&#091;'brand']&#091;'name'] = 'Rank Math';\n    return $entity;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-worksfor\">12. Filter to remove <code>trabaja para<\/code> property from the Post Author Schema<\/h3>\n\n\n\n<p id=\"block-91e8d30e-59bd-4ab1-a5b7-04e80e01a911\">This filter is helpful when you have guest writers.  <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter( 'rank_math\/json_ld', function( $data, $jsonld ) {\n    if ( ! isset( $data&#091;'ProfilePage'] ) ) {\n        return $data;\n    }\n    global $post;\n    $author_id = is_singular() ? $post-&gt;post_author : get_the_author_meta( 'ID' );\n    if ( in_array( intval( $author_id ), &#091; 1, 2, 3 ], true ) ) {     unset($data&#091;'ProfilePage']&#091;'worksFor']); }\n    return $data;\n}, 99, 2);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-shortcode-content\">13. Filter to Change the Shortcode Content<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the rank_math_rich_snippet shortcode content.\n *\n * @param string $shortcode_html\n *\/\nadd_filter( 'rank_math\/snippet\/html', function( $shortcode_html ) {\n\treturn $shortcode_html;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-worksfor\">14. Filter to remove <code>trabaja para<\/code> from the Author Entity<\/h3>\n\n\n\n<p>If the post author is not working for your company or is a guest author, then use this filter to remove <code>trabaja para<\/code> attribute from the Author entity.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove <code>worksFor<\/code> from the Author Entity.\n *\/\nadd_filter( 'rank_math\/json_ld', function( $data, $jsonld ) {\n    if ( ! isset( $data&#091;'ProfilePage'] ) ) {\n        return $data;\n    }\n    global $post;\n    $author_id = is_singular() ? $post-&gt;post_author : get_the_author_meta( 'ID' );\n    if ( in_array( $author_id, &#091; 1, 2, 3 ], true ) ) {\n        unset($data&#091;'ProfilePage']&#091;'worksFor']);\n    }\n    return $data;\n}, 99, 2);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-video-thumbnail-attachment-title\">15. Filter to change the Attachment title of the video thumbnail<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter the attachment title of the video thumbnail.\n *\n * @param string $attachment_title The attachment title of the video thumbnail.\n * @param array  $data             The video data.\n * @param object $post             The post object.\n *\/\nadd_filter('rank_math\/schema\/video_thumbnail_attachment_title', function ($attachment_title, $data, $post) {\n    return $attachment_title;\n}, 10, 3 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-video-thumbnail-filename\">16. Filter to change the Filename of the video thumbnail<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter the filename of the video thumbnail.\n *\n * @param string $filename The filename of the video thumbnail.\n * @param array  $data     The video data.\n * @param object $post     The post object.\n *\/\nadd_filter('rank_math\/schema\/video_thumbnail_filename', function ($filename, $data, $post) {\n    return $filename;\n}, 10, 3 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-pros-cons-labels\">17. Filter to change the Pros and Cons labels<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: Allow changing the Pros &amp; Cons labels.\n *\n * @param array $labels {\n *  @type string $pros Pros label.\n *  @type string $cons Cons label.\n * }\n *\/\nadd_filter( 'rank_math\/schema\/review_notes_labels', function( $labels ) {\n\treturn $labels;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"schema-nested-blocks\">18. Filter to change the nested blocks to be parsed<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: 'rank_math\/schema\/nested_blocks' - Allows filtering for nested blocks.\n *\n * @param array $data  Array of JSON-LD data.\n * @param array $block The block.\n *\/\nadd_filter('rank_math\/schema\/nested_blocks', function( $nested ) {\n    return $nested;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-block-content\">19. Filter to change the content of Rank Math Blocks<\/h3>\n\n\n\n<p>Ensure that you change the <code>$block<\/code> variable in the below filter to specific blocks to <code>howto<\/code>, <code>faq<\/code>, etc<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>**\n * Filter to change the output of Rank Math Block.\n *\n * @param string $output        Output of the Block.\n * @param array  $block_content Original block content before it is escaped.\n * @param array  $attributes    Attributes of the Block.\n *\/\nadd_filter( 'rank_math\/schema\/block\/$block\/content', function ( $output, $block_content, $attributes ) {\n\treturn $output;\n}, 10, 3 );<\/code><\/pre>\n\n\n\n<p>Here&#8217;s how to use the filter for TOC Block.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the output of TOC Block.\n *\n * @param string $output        Output of the TOC Block.\n * @param string $block_content Unescaped Block content.\n * @param array  $attributes    Attributes of the HowTo Schema Block.\n *\/\nadd_filter( 'rank_math\/schema\/block\/toc\/content', function ( $output, $block_content, $attributes ) {\n\treturn $output;\n}, 10, 3 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-searchaction-schema\">20. Filter to Disable SearchAction Schema<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to disable SearchAction Schema\n *\n *\/\nadd_filter( 'rank_math\/json_ld\/disable_search', '__return_true' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-global-schema-entities\">21. Filter to Remove Global Schema Entities<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\n\/**\n * Filter to remove the Global Schema Entities.\n *\n * @param   string  $value    The original Global Schema Entities.\n * @return  string            The filtered Global Schema Entities.\n *\/\nadd_filter( 'rank_math\/schema\/add_global_entities', function( $value ) {\n\t\n    if ( is_singular() ) {\n\t\treturn false;\n\t}\n\n\treturn $value;\n} );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"seo-score\">Puntuaci\u00f3n SEO<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-seo-score-args\">1. Filter to change parameters for the Front End SEO Score output.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change parameters for the Front End SEO Score output.\n * Available parameters are: 'template', 'backlink', 'post_id', 'class'.\n *\n * @param array $args Parameters array.\n * @return array\n *\/\nadd_filter( \"rank_math\/frontend\/seo_score\/args\", function( $args ) {\n return $args;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-seo-score-html\">2. Filter to change HTML output for the Front End SEO Score function.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change HTML output for the Front End SEO Score function.\n *\n * @param string $html HTML output.\n * @param array $args Function parameters.\n * @param string $score calculated SEO score.\n * @return string\n *\/\nadd_filter( \"rank_math\/frontend\/seo_score\/html\", function( $html, $args, $score ) {\n return $html;\n}, 10, 3);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-seo-score-backlink\">3. Filter to change the backlink inside the Front End SEO Score output.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to change the backlink inside the Front End SEO Score output.\n *\n * @param string $backlink Backlink HTML.\n * @return string\n *\/\nadd_filter( \"rank_math\/frontend\/seo_score\/backlink\", function( $backlink ) {\n return $backlink;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"hide-seo-score\">4. Filter to hide SEO score<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to hide SEO Score\n *\/\nadd_filter( 'rank_math\/show_score', '__return_false' );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"redirections\">Redirecciones<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"process-redirections\">1. Change number of redirections to process at once<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to change number of redirections to process at once.\n *\n * @param int $number\n *\/\nadd_filter( 'rank_math\/redirections\/pastedContent', function( $number ) {\n\treturn $number;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"redirect-remove-query\">2. Filter to disable appending the query string in the redirection URL<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Disable appending the query string in the redirection URL.\n *\n * @param bool \t$value \t\tEnable or disable appending the query string.\n * @param array $matched\tMatched redirection.\n *\/\nadd_filter( 'rank_math\/redirection\/add_query_string', function($value, $matched) {\n\treturn false;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-custom-product-redirection\">3. Filter to disable custom product redirection<\/h3>\n\n\n\n<p>Use this filter to disable custom product redirection when the option <a href=\"https:\/\/rankmath.com\/kb\/general-settings\/#remove-base\">Remove base<\/a> o <a href=\"https:\/\/rankmath.com\/kb\/general-settings\/#remove-category-base\">Eliminar categor\u00eda base<\/a> is enabled for WooCommerce products.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/** * Filtro para deshabilitar la redirecci\u00f3n de productos personalizados. *\/ add_filter(&#039;rank_math\/woocommerce\/product_redirection&#039;, &#039;__return_false&#039;);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"strip-leading-slashes-regex\">4. Filter to strip leading slashes for Regex redirections<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to strip leading slashes for Regex redirections\n *\/\nadd_filter( 'rank_math\/redirection\/get_clean_pattern', function( $cleaned, $pattern, $comparison ) {\n\tif ( $comparison === 'regex' ) {\n\t\t$cleaned = '@' . stripslashes( ltrim( $pattern, '\/' ) ) . '@';\n\t}\n\treturn $cleaned;\n}, 10, 3 );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ai-link-genius\">AI Link Genius<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-keyword-maps\">1. Filter to Enable or Disable the Keyword Maps Autolinking Globally<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to enable or disable the Keyword Maps auto-linking feature globally.\n *\n * @param bool $enabled Whether auto-linking is enabled. Default true.\n *\n *\/\nadd_filter( 'rank_math\/link_genius\/auto_link_enabled', function( $enabled ) {\n    return $enabled;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"keyword-maps-post-types\">2. Filter to Select Post Types for Keyword Maps Autolinking<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to filter which post types support Keyword Maps auto-linking.\n * By default, all publicly accessible post types are included.\n *\n * @param array $post_types Array of post type slugs that support keyword maps.\n *\n *\/\nadd_filter( 'rank_math\/keyword_maps\/supported_post_types', function( $post_types ) {\n    return $post_types;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"choose-gutenberg-blocks-for-link-insertion\">3. Filter to Choose Gutenberg Blocks for Automatic Link Insertion<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to control which Gutenberg block types allow automatic link insertion.\n *\n * @param array $safe_block_types Array of block type names. Default: &#091; 'core\/paragraph', 'core\/heading' ].\n *                                Must use exact parse_blocks() format, e.g. 'core\/paragraph' not 'paragraph'.\n *\n *\/\nadd_filter( 'rank_math\/link_genius\/keyword_maps\/safe_block_types', function( $safe_block_types ) {\n    return $safe_block_types;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-link-audit-status-check\">4. Filter to Enable to Disable Link Audit Status check for a post<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to enable or disable Link Audit status checking on post save.\n *\n * @param bool  $should_queue      Whether to queue links for status checking. Default true.\n * @param int   $post_id           ID of the post being saved.\n * @param array $link_data_for_queue Array of link data that would be queued.\n *\n *\/\nadd_filter( 'rank_math\/link_genius\/queue_links_on_save', function( $should_queue, $post_id, $link_data_for_queue ) {\n    return $should_queue;\n}, 10, 3 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-http-request-timeout-duration\">5. Filter to Change the HTTP Request Timeout Duration<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to change the HTTP request timeout for the Link Status Crawler.\n *\n * @param int $timeout Timeout in seconds per URL check. Default 5.\n *\n *\/\nadd_filter( 'rank_math\/link_genius\/crawler_request_timeout', function( $timeout ) {\n    return $timeout;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-number-of-items-processed\">6. Filter to change the number of items processed per background job<\/h3>\n\n\n\n<p>This filter allows developers to change the number of items processed per background job for any Link Genius background operation. Replace <code>{$operation}<\/code> with the specific operation name from the table below.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><code>{$operation}<\/code><\/td><td>Unit Processed<\/td><td>Default<\/td><td>Secci\u00f3n<\/td><\/tr><tr><td><code>preview<\/code><\/td><td>Enlaces<\/td><td>100<\/td><td>Bulk Update<\/td><\/tr><tr><td><code>bulk_delete<\/code><\/td><td>publicaciones<\/td><td>10<\/td><td>Bulk Update<\/td><\/tr><tr><td><code>bulk_delete_fetch<\/code><\/td><td>Enlaces<\/td><td>1000<\/td><td>Bulk Update<\/td><\/tr><tr><td><code>bulk_mark_safe<\/code><\/td><td>Enlaces<\/td><td>50<\/td><td>Bulk Update<\/td><\/tr><tr><td><code>bulk_mark_safe_fetch<\/code><\/td><td>Enlaces<\/td><td>1000<\/td><td>Bulk Update<\/td><\/tr><tr><td><code>bulk_restore<\/code><\/td><td>publicaciones<\/td><td>10<\/td><td>Bulk Update<\/td><\/tr><tr><td><code>regenerate<\/code><\/td><td>publicaciones<\/td><td>200<\/td><td>Regeneration<\/td><\/tr><tr><td><code>exportar<\/code><\/td><td>registros<\/td><td>5000<\/td><td>Export<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to change the chunk size for a Link Genius background operation.\n *\n * @param int $chunk_size Number of items (posts or links depending on operation) to process per job.\n *\n *\/\nadd_filter( 'rank_math\/link_genius\/{$operation}_chunk_size', function( $chunk_size ) {\n    return $chunk_size;\n} );<\/code><\/pre>\n\n\n\n<p class=\"takeaway yellow\"><strong>Nota:<\/strong> los <code>fetch<\/code> variants (<code>bulk_delete_fetch<\/code>, <code>bulk_mark_safe_fetch<\/code>) control how many links are loaded from the database per cursor iteration. Larger values reduce query count but increase memory usage.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"maximum-number-of-records-exported\">7. Filter to change the maximum number of records exported synchronously<\/h3>\n\n\n\n<p>This filter would allow developers to change the maximum number of records exported synchronously (without background processing). Exports exceeding this limit are processed in the background.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to change the maximum number of records for immediate (synchronous) export.\n *\n * @param int $limit Maximum number of records for immediate export. Default 1000.\n *\n *\/\nadd_filter( 'rank_math\/link_genius\/export_limit', function( $limit ) {\n    return $limit;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"maximum-number-of-candidate-posts\">8. Filter to change the maximum number of candidate posts for AI Link Suggestions<\/h3>\n\n\n\n<p>This filter would allow developers to change the maximum number of candidate posts considered when building the similarity pool for AI link suggestions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to change the maximum number of candidate posts in the AI link suggestions pool.\n *\n * @param int $target_limit Maximum number of candidate posts. Default 100.\n *\n *\/\nadd_filter( 'rank_math\/ai_link_suggestions\/target_limit', function( $target_limit ) {\n    return $target_limit;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"maximum-number-of-top-candidates\">9. Filter to change the maximum number of top-ranked candidates for AI Link Suggestions<\/h3>\n\n\n\n<p>This filter would allow developers to change the maximum number of top-ranked candidates kept for AI refinement during link suggestion processing.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to change the number of top candidates passed to AI refinement for link suggestions.\n *\n * @param int $top_limit Maximum number of top candidates to keep. Default 20.\n *\n *\/\nadd_filter( 'rank_math\/ai_link_suggestions\/top_candidates_limit', function( $top_limit ) {\n    return $top_limit;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"modify-related-posts\">10. Filter to Modify the Related Posts Results<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to modify the Related Posts results before they are returned.\n *\n * @param array $results  Array of related post results.\n * @param int   $post_id  ID of the source post.\n * @param array $args     Arguments used to fetch results.\n *\n *\/\nadd_filter( 'rank_math\/content_ai\/related_posts\/results', function( $results, $post_id, $args ) {\n    return $results;\n}, 10, 3 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"maximum-char-length-related-posts\">11. Filter to change the maximum character length of post content for Related Posts Comparison<\/h3>\n\n\n\n<p>This filter would allow developers to change the maximum character length of post content used for Related Posts similarity comparison.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to change the maximum text length used for Related Posts similarity comparison.\n *\n * @param int $max_len  Maximum number of characters. Default 20000.\n * @param int $post_id  ID of the post being compared.\n *\n *\/\nadd_filter( 'rank_math\/content_ai\/related_posts\/target_text_max_length', function( $max_len, $post_id ) {\n    return $max_len;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"modify-related-posts-block\">12. Filter to Modify the Final HTML Output of Related Posts Gutenberg Block<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to modify the Related Posts block HTML output.\n *\n * @param string $output     Rendered HTML output of the block.\n * @param array  $items      Array of related post items.\n * @param array  $attributes Block attributes from the editor.\n *\n *\/\nadd_filter( 'rank_math\/content_ai\/related_posts\/block_output', function( $output, $items, $attributes ) {\n    return $output;\n}, 10, 3 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"modify-related-posts-shortcode\">13. Filter to Modify the Final HTML Output of the <code>[rank_math_related_posts]<\/code> C\u00f3digo corto<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to modify the Related Posts shortcode HTML output.\n *\n * @param string $output Rendered HTML output of the shortcode.\n * @param array  $items  Array of related post items.\n * @param array  $atts   Shortcode attributes.\n *\n *\/\nadd_filter( 'rank_math\/content_ai\/related_posts\/shortcode_output', function( $output, $items, $atts ) {\n    return $output;\n}, 10, 3 );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"gutenberg\">Gutenberg<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-gutenberg-sidebar\">1. Filter to disable Rank Math Integration from the Gutenberg Sidebar<\/h3>\n\n\n\n<p>Use this filter to remove Rank Math integration from the Gutenberg Sidebar and add old meta boxes below the content area.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Disable Gutenberg Sidebar Integration\n *\/\nadd_filter( 'rank_math\/gutenberg\/enabled', '__return_false' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-metakey-in-gutenberg\">2. Filter to add meta keys for enqueueing data in the Gutenberg<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add meta keys for enqueueing data in the Gutenberg\n *\/\nadd_filter( 'rank_math\/metabox\/{$type}\/meta_keys', function( $keys ) {\n\t$keys&#091;'facebookTitle'] = 'facebook_title';\n\treturn $args;\n} );<\/code><\/pre>\n\n\n\n<p>When using this meta key, please prefix it with <code>rank_math_<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-metadata-in-gutenberg\">3. Filter to add metadata for enqueueing for Gutenberg use<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add metadata for enqueueing for Gutenberg use\n *\/\nadd_filter( 'rank_math\/metabox\/{$type}\/values', function( $values, $screen ) {\n\t$object_id   = $screen-&gt;get_object_id();\n\t$object_type = $screen-&gt;get_object_type();\n\t$values&#091;'videoSitemap'] = &#091;\n\t\t'robots'       =&gt; $screen-&gt;get_meta( $object_type, $object_id, 'rank_math_news_sitemap_robots' ),\n\t\t'genres'       =&gt; $screen-&gt;get_meta( $object_type, $object_id, 'rank_math_news_sitemap_genres' ),\n\t\t'keywords'     =&gt; $screen-&gt;get_meta( $object_type, $object_id, 'rank_math_news_sitemap_keywords' ),\n\t\t'stockTickers' =&gt; $screen-&gt;get_meta( $object_type, $object_id, 'rank_math_news_sitemap_stock_tickers' ),\n\t];\n\treturn $values;\n} );<\/code><\/pre>\n\n\n\n<p><code>$type<\/code> can be post, term, and user.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"elementor\">Elementor<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-seo-panel-elementor\">1. Filter to remove SEO Tab in Elementor Editor<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to hide SEO Tab in the Elementor Editor.\n *\/\nadd_filter( 'rank_math\/elementor\/add_seo_tab', '__return_false' );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"divi\">Divi<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-seo-panel-divi\">1. Filter to remove SEO Tab in Divi Editor<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to hide SEO Tab in the Divi Editor.\n *\/\nadd_filter( 'rank_math\/divi\/add_seo_tab', '__return_false' );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"misc\">Misc<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change-redirect-url\">1. Filter to change redirect_url of Redirect attachment to its parent post<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Redirect the attachment to its parent post.\n *\n * @param string $redirect URL as calculated for redirection.\n *\/\nadd_filter( 'rank_math\/frontend\/attachment\/redirect_url', function( $redirect ) {\n\treturn $redirect;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-nofollow\">2. Filter to remove the nofollow rel tag from RSS links<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Let developers determine hether or not to add rel=\"nofollow\" to the links added by Rank Math to the RSS feed. This defaults to true.\n *\n * @param bool $unsigned To allow or not to follow the links in RSS feed, defaults to true.\n *\/\n\t\tadd_filter( 'rank_math\/frontend\/rss\/nofollow_links', '__return_false' );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"allow-rss-footer\">3. Filter to allow RSS footer to be dynamically shown\/hidden in an RSS feed item<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Show or hide the RSS footer dynamically.\n *\n * @param bool   $show_embed Whether RSS footer should be shown or not.\n * @param string $context    Indicated the context of the RSS content - whether 'full' or 'excerpt'.\n *\/\nadd_filter( 'rank_math\/frontend\/rss\/include_footer', function( $bool, $context) {\n\treturn $bool;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-remove-content-before-rss\">4. Filter to add\/remove content before RSS feed item.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter code to change content before RSS feed item\n *\n * @param string $content The content set in Settings.\n *\/\nadd_filter( 'rank_math\/frontend\/rss\/before_content', function( $content ) {\n\treturn $content ;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-remove-content-after-rss\">5. Filter to add\/remove content after RSS feed item.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter code to change content after RSS feed item\n *\n * @param string $content The content set in Settings.\n *\/\nadd_filter( 'rank_math\/frontend\/rss\/after_content', function( $content ) {\n\treturn $content ;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-rel-noopener\">6. Filter to remove rel=&#8221;noopener&#8221; from external links.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter code to remove noopener rel from external links.\n *\/\nadd_filter( 'rank_math\/noopener', '__return_false');\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-primary-term-feature\">7. Filter to disable primary term feature.<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to allow disabling of the primary term feature.\n *\n * @param bool $return True to disable.\n *\/\nadd_filter( 'rank_math\/admin\/disable_primary_term', '__return_true' );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-replytocom-query\">8. Filter to remove `?replytocom` query parameters from URLs<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: 'rank_math_remove_reply_to_com' - Allow or disable the Rank Math feature that removes `?replytocom` \n * query parameters from URLs.\n * @param bool $return True to remove, false not to remove.\n *\/\nadd_filter( 'rank_math\/frontend\/remove_reply_to_com', '__return_false');\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-homepage-blog-snippet\">9. Filter to remove Blog Snippet on homepage<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: Remove\/modify schema data.\n *\n * @param array $return Array of json-ld data.\n *\/\nadd_filter( 'rank_math\/json_ld', function( $data, $json ) {\n\tif ( is_home() &amp;&amp; isset( $data&#091;'Blog'] ) ) { \/\/ Remove Blog Snippet from homepage.\n\t\tunset( $data&#091;'Blog'] );\n\t}\n\treturn $data;\n}, 10, 2 );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-footer-credit\">10. Filter to prevent Rank Math from changing admin_footer_text<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter: Prevent Rank Math from changing admin_footer_text.\n *\/\nadd_action( 'rank_math\/whitelabel', '__return_true');\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-noopener-attribute\">11. Remove noopener attribute based on a domain<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add\/remove noopener attribute based on a domain.\n * \n * @param string $domain The domain in question.\n * \n * @return boolean\n *\/\nadd_filter( 'rank_math\/noopener\/domain', function( $domain ) {\n\t$exclude = &#091;\n\t\t'github.com',\n\t\t'google.com',\n\t];\n\n\tif ( in_array( $domain, $exclude ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-target-blank-attribute\">12. Remove <code>target_blank<\/code> attribute based on domain<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add\/remove target_blank attribute based on a domain.\n * \n * @param string $domain The domain in question.\n * \n * @return boolean\n *\/\nadd_filter( 'rank_math\/target_blank\/domain', function( $domain ) {\n\t$exclude = &#091;\n\t\t'github.com',\n\t\t'google.com',\n\t];\n\n\tif ( in_array( $domain, $exclude ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"clear-rm-data\">13. Remove everything related to Rank Math from Database<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove Rank Math data from the database\n *\/\nadd_filter( 'rank_math_clear_data_on_uninstall', '__return_true' );\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Add above code in the theme&#8217;s <code>funciones.php<\/code> file (the above code will not work in the <code>rango-matematicas.php<\/code> file)<\/li>\n\n\n\n<li>Deactivate and delete the Rank Math plugin<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sitelinks-searchbox\">14. Filter to customize the Search URL for Sitelinks Searchbox<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allows filtering of the search URL.\n *\n * @param string $search_url The search URL for this site with a `{search_term_string}` variable.\n *\/\nadd_filter( 'rank_math\/json_ld\/search_url',  function( $url ) {\n    return $url;\n});\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-toc-plugin\">15. Filter to add plugins to the Table of Contents List<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to add plugins to the TOC list.\n *\n * @param array TOC plugins.\n *\/\nadd_filter( 'rank_math\/researches\/toc_plugins', function( $toc_plugins ) {\n       $toc_plugins&#091;'plugin-directory\/plugin-filename.php'] = 'Plugin Name';\n    return $toc_plugins;\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-rank-math-link-class\">16. Filter to remove <code>enlace matem\u00e1tico de clasificaci\u00f3n<\/code> class from the frontend content links<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to remove `rank-math-link` class from the frontend content links\n *\/\nadd_filter( 'rank_math\/link\/remove_class', '__return_true' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"hide-analytics-stats-bar\">17. Filter to hide Analytics Stats Bar from the frontend<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to hide Analytics Stats bar from the frontend\n *\/\nadd_filter( 'rank_math\/analytics\/frontend_stats', '__return_false' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"analytics-debug-log\">18. Filter to create Analytics debug log<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to create Analytics debug.log file\n *\/\nadd_filter( 'rank_math\/analytics\/log_response', '__return_true' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"modify-link-counter-content\">19. Filter to modify the content passed to the Link Counter<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to modify the content passed to the Link Counter.\n *\n * @param string $content Post content.\n * @param int    $post_id Post ID.\n *\/\nadd_filter( 'rank_math\/links\/content', function ( $content, $post_id) {\n\treturn $content;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prevent-link-counter-processing-post\">20. Filter to prevent Link Counter from processing the post<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to prevent processing the post.\n *\n * @param boolean $value Whether to process the post.\n * @param WP_POST $post  The Post object.\n *\/\nadd_filter( 'rank_math\/links\/process_post', function( $value, $post ) {\n    return false;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"allow-editing-robots.txt-htaccess\">21. Filter to allow editing robots.txt &amp; htaccess data<\/h3>\n\n\n\n<p>This filter lets you allow\/disallow editing robots.txt and htaccess from Rank Math General Settings regardless of the value set for the <code>DISALLOW_FILE_EDIT<\/code> y <code>DISALLOW_FILE_MODS<\/code>. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow editing the robots.txt &amp; htaccess data.\n *\n * @param bool Can edit the robots &amp; htacess data.\n *\/\n\nadd_filter( 'rank_math\/can_edit_file', '__return_true' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-nofollow-from-specific-external-links\">22. Filter to remove nofollow tag from specific external links<\/h3>\n\n\n\n<p class=\"takeaway yellow\"><strong>Nota:<\/strong> This filter works only for nofollow tags added <a href=\"https:\/\/rankmath.com\/kb\/nofollow-specific-external-links\/\">using Rank Math<\/a> or not for manually added tags.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Allow developers to remove nofollow tag from specific external links\n *\n * @param $add_no_follow bool Should add no follow attribute.\n * @param string $href The URL string for the external link.\n *\/\nadd_filter('rank_math\/nofollow\/url', function ( $add_no_follow, $href ) {\n    if ( $href === 'https:\/\/wordpress.org\/gutenberg\/') { \/\/ maybe in_array compare\n        return false;\n    }\n    return $add_no_follow;\n}, 10, 2);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-cache\">23. Filter to disable cache used in the plugin<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to disable cache used in the plugin.\n *\/\nadd_filter( 'rank_math\/cache\/enabled', '__return_false' );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"modify-json-data\">24. Filter to Modify Rank Math JSON data<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to modify Rank Math JSON data.\n *\/\nadd_filter( 'rank_math\/json_data', function( $data ) {\n\t$data&#091;'testing'] = wp_create_nonce( 'rank-math' );\n\treturn $data;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"update-404-pages-hook\">25. Filter to update the hook used for monitoring 404 pages<\/h3>\n\n\n\n<p>If you&#8217;re using plugins like Elementor or others to create custom 404 templates, then use this filter to update the hook accordingly to enable Rank Math to monitor these custom 404 pages.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to update the hook used for monitoring 404 pages\n *\/\nadd_filter( 'rank_math\/404_monitor\/hook', function($hook ){\n    return 'template_redirect'; \/\/change to your preferred hook\n});<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exclude-post-in-llms-txt\">26. Filter to exclude a specific post from llms.txt file<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to Exclude a Specifc Post from llms.txt file\n *\n * @param  array $args  WP_Query arguments\n *\/\nadd_filter( 'rank_math\/llms_txt\/posts_query_args', function( $args ) {\n\t$args&#091;'post__not_in'] = &#091; 1 ]; \/\/ Excludes the post with ID 1\n\treturn $args;\n} );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"update-post-list-llms-txt\">27. Filter to update the list of posts to be included in the llms.txt file<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to Update the list of posts to be included in llms.txt file\n *\n * @param  array $posts Posts array\n * @param  array $args  WP_Query arguments\n *\/\nadd_filter( 'rank_math\/llms_txt\/posts', function( $posts, $args ) {\n   return $posts;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"update-terms-list-llms-txt\">28. Filter to update the list of terms to be included in the llms.txt file<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Filter to Update the list of terms to be included in llms.txt file\n *\n * @param  array $terms Terms array\n * @param  array $args  WP_Query arguments\n *\/\nadd_filter( 'rank_math\/llms_txt\/terms', function( $terms, $args ) {\n   return $terms;\n}, 10, 2 );<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"edit-extra-content-llms-txt\">29. Filter to edit the additional content in the llms.txt file<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n* Filter the additional content to be included in llms.txt file\n*\n* @param string $extra Extra content\n*\/\nadd_filter( 'rank_math\/llms_txt\/extra_content', function( $extra) {\n   return $extra;\n});<\/code><\/pre>\n\n\n\n<p>And, that&#8217;s it! We hope the article was helpful in taking advantage of the various filters and hooks available with Rank Math. If you&#8217;ve any questions or need any help in using these filters, please feel free to get in touch with our <a href=\"https:\/\/rankmath.com\/support\/\">equipo de soporte directamente desde aqu\u00ed<\/a>, y siempre estamos aqu\u00ed para ayudar.<\/p>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>We have incorporated various hooks and filters in the Rank Math SEO plugin that developers can use to interact with data output by Rank Math. You can control Rank Math data from within your themes\/plugins. Before going through the different filters and hooks that Rank Math offers, we&#8217;d discuss how to add them to your [&hellip;]<\/p>","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[161],"ht-kb-tag":[],"class_list":{"0":"post-388694","1":"ht_kb","2":"type-ht_kb","3":"status-publish","4":"format-standard","6":"ht_kb_category-developers"},"_links":{"self":[{"href":"https:\/\/rankmath.com\/es\/wp-json\/wp\/v2\/ht-kb\/388694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rankmath.com\/es\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/rankmath.com\/es\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/rankmath.com\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rankmath.com\/es\/wp-json\/wp\/v2\/comments?post=388694"}],"version-history":[{"count":11,"href":"https:\/\/rankmath.com\/es\/wp-json\/wp\/v2\/ht-kb\/388694\/revisions"}],"predecessor-version":[{"id":1749345,"href":"https:\/\/rankmath.com\/es\/wp-json\/wp\/v2\/ht-kb\/388694\/revisions\/1749345"}],"wp:attachment":[{"href":"https:\/\/rankmath.com\/es\/wp-json\/wp\/v2\/media?parent=388694"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/rankmath.com\/es\/wp-json\/wp\/v2\/ht-kb-category?post=388694"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/rankmath.com\/es\/wp-json\/wp\/v2\/ht-kb-tag?post=388694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}