How you change “og:type”

#136526
  • Resolved Prajit Chakraborty
    Rank Math free

    Hello Mate,

    I am having trouble to change my website “og:type” content=”article” to “og:type” content=”website” for all my inner pages(services). Can you please let me help to fix this problem.

    Thanks
    Prajit

Viewing 1 replies (of 1 total)
  • Danial
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and sorry for the inconvenience caused by this.

    You can try it as follows to change the meta for the pages:

    
    /**
     * 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 ) {
     if(is_page()){
         return "Website";
     }
    	return $type;
    });
    

    Here is the link to this:
    https://rankmath.com/kb/filters-hooks-api-developer/#1-filter-to-change-opengraph-type-ogtype

    I hope this resolves your issue.

    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 ‘How you change “og:type”’ is closed to new replies.