Add Open Graph Meta into WordPress without Plugin

You share a post of your wordpress blog in a social media, but not satisfied with the result. Because the shared post do not shows the proper image or the proper post title or description.

Here is a code you need to insert in your theme’s function file. This code will help social media to fetch proper information of your posts.

Whenever a post is shared in social media, this code will help social media to fetch post title, post description or post excerpt, featured image of that post if set, otherwise a default image is shown. That’s everything the basic of sharing a post through social media.

You need to put a default image (here wbxpress.png is used) in your theme’s folder inside images sub-folder.

If you need a detailed explanation of the codes above you read it from here.

Now you may check whether it really works or not from this debug tool by facebook.


Leave a Reply

Your email address will not be published. Required fields are marked *