Course Schema rank-math-title heading tag

#65300
  • Resolved Go Go
    Rank Math free

    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 3 years, 9 months ago by Go Go.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Go Go
    Rank Math free

    Thanks!

    • This reply was modified 3 years, 9 months 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.

    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 2 replies - 1 through 2 (of 2 total)

The ticket ‘Course Schema rank-math-title heading tag’ is closed to new replies.