Control How WordPress Posts Look on Social Media, with Open Graph

You want your WordPress posts and pages to look as good as possible when they're shared on social media. Here's how to control that, using the Yoast SEO plugin to set Open Graph meta data. Watch the video, or read the notes below it.

What you're trying to do is make sure that social media platforms pull the right title, description, and image from your WordPress post/page. Here's an example from Facebook:

WordPress post shared on Facebook

Set Default Image For Site

You want a default image for your site, so that if a post/page doesn't have an image, social media platforms still have something to show. Otherwise you'll get an ugly blank instead of an image.

The Yoast SEO plugin lets you set this in SEO > Social > Facebook > Image URL. Set this to your logo or some other branded image.

Here's a post that doesn't have its Featured Image set. Facebook pulls the site's default image:

Default image in Facebook post

Set Image For Post/Page

Every page and post in WordPress has its own Featured Image. Set this, and it'll be the first choice for social media.

To set a separate image for certain social platforms, click the Social tab in the Yoast SEO box, then expand Facebook and/or Twitter, and set the image.

Set Title For Post/Page

By default, this will be your post/page title. To customize it, write a different title in the Yoast SEO box that appears when you edit your post/page. If you write it in the Snippet Editor, it will apply to search engines (Google, Bing, etc.) as well as to social media.

To set a separate title for certain social platforms, click the Social tab in the Yoast SEO box, then expand Facebook and/or Twitter, and write the title.

Set Description For Post/Page

By default, this will be the first part of the text of your post/page title. That's not ideal. To customize it, write a different description in the Yoast SEO box that appears when you edit your post/page. If you write it in the Snippet Editor, it will apply to search engines (Google, Bing, etc.) as well as to social media.

To set a separate description for certain social platforms, click the Social tab in the Yoast SEO box, then expand Facebook and/or Twitter, and write the description.

Troubleshooting How Posts Appear On Social

A great way to troubleshoot how posts appear on social is Facebook's Sharing Debugger. Enter the URL you want to test, and click Debug. That shows what Facebook already has for that URL.

To force Facebook to check the URL again, click Scrape again button near the top of the page, then check the results again. You may need to click that 2-3 times for Facebook to show the latest info.

Your Turn

This looks like a lot of work, but the basics are pretty simple. And you're probably already doing most or all of this anyway; you're probably already setting the Featured Image so it shows on your site, and you're probably already writing descriptions for the sake of SEO.

Does Your WordPress Site Need Maintenance?

It’s important to use social media to drive traffic to your site. But are you staying on top of WordPress updates, backups, and security? We can help your website run smoothly—and safely. Sign up for your WordPress Maintenance Plan today.

Filed Under: 
Tagged With: , ,

Want tips to rocket-boost your website?

Simply sign up.

3 comments on “Control How WordPress Posts Look on Social Media, with Open Graph”

  1. Pls ,my blog shows posts titles when the homepage URL is shared on social media, other links is okay.
    How do I solve this, u didn't mention it above.
    I use rankmath

    1. Isaac, I checked the source code of your homepage, and the meta property=og:title which contains the blog post title appears under the line Open Graph Meta Tags generated by Simple Social Buttons. So you'll need to look at the Simple Social Buttons to see why it's doing that. Check that plugin's settings, search online for a solution, and, if necessary, contact the plugin developer.

Ready to Blast Off?

Let's talk.

Contact OptimWise
crossmenuarrow-right