Split: Open graph tag “og:type”

#660042
  • Resolved Anonymous
    Rank Math free

    do i have to do this every time i post something? i also want to change og:type for category pages. Please add this setting to rankmath plugin.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention.

    Apologies for the delay as we currently have a high volume of tickets here in our support forums.

    We have split your concern into a new ticket so we can assist you accordingly.

    You can modify the filter so you won’t need to add the filter every time you post. You can add a conditional statement to the filter to only apply to your post categories like this:

    /**
     * Allows theme developers to change the OpenGraph type of the page.
     *
     * @param string $type The OpenGraph type string.
     */
    add_filter( 'rank_math/opengraph/type', function( $type ) {
        //global $post;
    	if (is_category()){
    	$type = 'website';
    }
    	return $type;
    });

    If you’re not sure how to add this code, you can follow this guide:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

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

The ticket ‘Split: Open graph tag “og:type”’ is closed to new replies.