How to Put Automatically Meta Description for Facebook and Twitter in Every Post or Pages Blogger

In today's digital landscape, having a strong social media presence is essential for reaching a wider audience and driving traffic to your website or blog. To maximize the visibility of your content on platforms like Facebook and Twitter, it's crucial to create compelling meta descriptions. In this article, we will guide you through the process of crafting effective meta descriptions that entice users to click, engage, and share your posts.

How to Put Automatically Meta Description for Facebook and Twitter in Every Post or Pages Blogger. source : ichsanmarifat.blogspot.com private property


let me guide you hot to put meta description for facebook and twitter automatically in every post, every pages of your blogger. here a trick.

To set the Facebook and Twitter meta description for your Blogger blog, you can follow these steps:

1. Access the Blogger dashboard: Sign in to your Blogger account and navigate to the dashboard.
2. Go to the "Layout" section: From the left-hand menu, click on "Layout."
3. Edit HTML: Find the section of your Blogger template where the `<head>` tag is defined. This is usually located within the `<head>` section of the template code.
4. Locate the existing `<head>` tag: Look for a line of code that starts with `<head>` and ends with `</head>`.
5. Add this code meta tag: below the `<head>` section, add the following code to set the Facebook and Twitter meta description:
section of the template code.

       <b:if cond='data:blog.pageType == "item"'>
  <b:if cond='data:post.featuredImage'>
    <meta expr:content='data:post.featuredImage' property='og:image'/>
  </b:if>
  <meta expr:content='data:post.snippet' property='og:description'/>
</b:if>

<b:if cond='data:blog.pageType == "static_page"'>
  <b:if cond='data:blog.metaImage'>
    <meta expr:content='data:blog.metaImage' property='og:image'/>
  </b:if>
  <meta expr:content='data:blog.metaDescription' property='og:description'/>
</b:if>
    
In the code above, the <b:if> conditions ensure that the code is executed only for individual posts (data:blog.pageType == "item") and static pages (data:blog.pageType == "static_page").

The expr:content attribute dynamically fetches the URL of the featured image (data:post.featuredImage) for individual posts or the meta image URL (data:blog.metaImage) for static pages and sets it as the Open Graph image. By making this modification, the first image in your Blogger post or page will be dynamically fetched and used as the Open Graph image, providing a visually appealing representation when shared on platforms like Facebook and twitter.

Post a Comment

Previous Post Next Post