Course Schema rank-math-title heading tag

  • Hi,

    By default, rankmath would automatically generate a h5 title for course schema <h5 class="rank-math-title"><span id="i-7">HEREEE</span></h5>,

    I’d like to turn the h5 tag to <strong> tag, usually I’d directly alter the core file.

    But, I wish to know whether I could have the code to add in function.php that could override the h5 and turn it to strong tag, without hacking the core file, as I don’t have to alter it every time the plugin updates.

    Thank you.

    • This topic was modified 1 week ago by Go Go.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thanks!

    • This reply was modified 1 week ago by Go Go.

    Hello,

    Thank you for contacting Rank Math today.

    To change the Rank Math’s Rich Snippet shortcode content you can use rank_math/snippet/html filter. To change the shortcode title, please add following code to your theme’s functions.php file:

    
    add_filter( 'rank_math/snippet/html', function( $shortcode_html ) {
    	$shortcode_html = str_replace( '<h5 class="rank-math-title">', '<strong class="rank-math-title">', $shortcode_html );
    	$shortcode_html = str_replace( '</h5>', '</div>', $shortcode_html );
    	return $shortcode_html;
    } );
    

    I hope that helps. Thank you.

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

You must be logged in to reply to this ticket.