Filter / Hooks For Dynamically Updating Index And No index / Crawl / No crawl

#714490
  • Resolved N E
    Rank Math free

    Do we have filters or hooks for this? and in schema dynamic url @id ….

    This is Custom, lmk if there are approaches for this ….

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello, we apologize for the inconvenience you’re experiencing.

    Regarding dynamically updating index and noindex, crawl and no-crawl, and dynamic URL @id in schema, Rank Math provides filters and hooks to customize these functionalities. You can use these filters and hooks to dynamically update the index and noindex settings, as well as control the crawling behavior.

    For dynamically updating index and noindex settings, you can use the rank_math/frontend/robots filter. This filter allows you to modify the robots meta tag output on the frontend.

    To control the crawling behavior, you can use the rank_math/frontend/crawl/noindex filter to dynamically update the noindex settings for specific pages.

    As for the dynamic URL @id in schema, you can use the rank_math/json_ld filter to modify the JSON-LD output for schema markup, including the dynamic URL @id.

    If you have custom requirements, these filters and hooks provide flexible approaches to customize Rank Math’s behavior based on your specific needs.

    If you need further assistance with implementing these filters and hooks, please let us know, and we’ll be happy to guide you through the process.

    Sources:
    Advanced Tab in Rank Math SEO’s Meta Box
    How to Use IndexNow With Rank Math » Rank Math
    Bulk Editing Options in the Rank Math SEO Plugin
    Configuring “Schema Markup” in Rank Math » Rank Math

    N E
    Rank Math free

    how do do this ? As for the dynamic URL @id in schema, you can use the rank_math/json_ld filter to modify the JSON-LD output for schema markup, including the dynamic URL @id.

    Hello,

    For updating the URLs dynamically to noindex/index, you may use and customize this fitler:

    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    	$url = home_url( $_SERVER['REQUEST_URI'] );
    	if (strpos($url,'?wpf_filter') !== false || strpos($url,'?wpf_fbv=')) {
                    $robots['index'] = "noindex";
                    $robots["follow"] = 'nofollow';
    	        return $robots;
            }
    	return $robots;
    });

    The filter above will set all URLs with ?wpf_filter to noindex and nofollow.

    Regarding the schema, here’s a sample filter you can customize as well:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    if( isset( $data['publisher'] )) {
    		$data['publisher']['@id'] = 'https://rankmathid.com';
    		return $data;
    } 
    	return $data;
    }, 99, 2);

    Hope that helps.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Filter / Hooks For Dynamically Updating Index And No index / Crawl / No crawl’ is closed to new replies.