[OFFER ALERT!] This Halloween, Get Any Premium Theme for Just $19 [GET IT NOW]
Jump to content

[Rank Math SEO Plugin] Deactivate Social?


Recommended Posts

Hi there,

I absolutely love Rank Math; thank you so much for this plugin.

I do have a question though. I'm using Rank Math on a site also using Social Pug, a social share plugin which also includes features for adding image and description when post is shared on social media, which means I don't need the Social from Rank Math. Can I deactivate that?

Or if just don't add Social details in Rank Math, will that be enough to ensure social sharing options (image / description) are pulled from Social Pug? 

Link to comment
Share on other sites

  • Support

Hello,

Thank you for contacting MyThemeShop today.

You won't need to disable anything in Rank Math for your social media Open Graph tags. Those are the tags that help share your content on social media.

If your content is currently sharing on social media, you don't have to modify anything.

Looking forward to helping you. Thank you.


🏁Rank #1 on Google With our WordPress SEO Plugin.

Score a 💯on PageSpeed and Dominate Search Rankings.

✏ Editing theme files? Please create a child theme to make your changes update-proof.

Link to comment
Share on other sites

  • Support

Hello

I wanted to chime in to help. To remove social meta completely, please add below code in your theme's funcitons.php file:

Code to remove Social Tab from Rank Math Metabox in Edit Post Screen: 

add_filter( 'rank_math/metabox/tabs', function( $tabs ) {
	unset( $tabs['social'] );
  return $tabs;
});

Code to remove social meta tags from frontend:

add_action( 'rank_math/head', function() {
  if( ! is_home() && ! is_front_page() && ! is_category() ) {
    remove_all_actions( 'rank_math/opengraph/facebook' );
    remove_all_actions( 'rank_math/opengraph/twitter' );
  }
});

As far as I know, Social Pug plugin only adds meta tags on posts and pages, so I added a condition to check is_home(), front_page & category before removing the social meta tags. Feel free to remove that condition if you want to remove social meta tags from all the pages.

Hope that helps. If there is anything else, please let us know.

Thank you.


🏁Rank #1 on Google With our WordPress SEO Plugin.

Score a 💯on PageSpeed and Dominate Search Rankings.

✏ Editing theme files? Please create a child theme to make your changes update-proof.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...