How to Add Social Sharing Images to a Tamil Language Website
Add page-specific Open Graph tags for Tamil pages, serve a public share image, and verify how social platforms render each URL.
To add a social sharing image to a Tamil-language website, put page-specific Open Graph metadata in each page’s HTML <head>, including og:title, og:type, og:url, and og:image. Point og:image to a real, publicly fetchable image. Set lang="ta" on the HTML element, write the title and description in Tamil when that matches the page, and choose an Open Graph locale that reflects the intended region.
Here is a complete starting example. Replace the example values with the actual page data and image URL:
<!doctype html>
<html lang="ta">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>தமிழ் பக்கத் தலைப்பு</title>
<link rel="canonical" href="https://example.com/ta/article/">
<meta property="og:type" content="article">
<meta property="og:title" content="தமிழ் பக்கத் தலைப்பு">
<meta property="og:description" content="இந்தப் பக்கத்தைப் பற்றிய சுருக்கமான விளக்கம்.">
<meta property="og:url" content="https://example.com/ta/article/">
<meta property="og:image" content="https://example.com/images/ta-article-share.jpg">
<meta property="og:image:alt" content="பக்கத்தின் உள்ளடக்கத்தை பிரதிபலிக்கும் படம்">
<meta property="og:locale" content="ta_IN">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
</head>
<body>
<h1>தமிழ் பக்கத் தலைப்பு</h1>
</body>
</html>
The sample locale ta_IN suits an India-localized Tamil page; it is not the right territory for every Tamil audience. HTML’s lang value and Open Graph’s locale are separate metadata fields. The Open Graph protocol defines the page metadata, while the HTML Standard and IANA language registry define language-tag behavior and the Tamil subtag.
1. Understand what social sharing metadata does
Open Graph metadata describes a page to services that create link previews. The tags provide the preview title, description, canonical page URL, and image URL. They do not upload or create the image: that file must already exist at a URL the service can fetch. Open Graph describes its purpose as enabling a web page to become a rich object in a social graph.
Each public page should describe itself. A site-wide template can emit the tags, but its values must come from that route’s content rather than repeating one generic title or image everywhere.
2. Prepare a Tamil page’s values
- Language: Add
lang="ta"to the page’s<html>element. If a section within the page switches to another language, mark that element with its own language tag. - Title and description: Use the page’s actual Tamil title and a concise description of its content. Keep them in the page language when the intended share experience is Tamil.
- Canonical URL: Set
og:urlto the public canonical URL for that page, not a preview, tracking, or session URL. Keep it aligned with the page’s canonical link. - Image: Create or select a representative image for this page and upload it to a stable, public URL. Avoid substituting a generic site logo when a relevant image is available.
- Locale: Choose a language-and-territory value that matches the localized audience.
ta_INis an example for Tamil content intended for India.
If the site has separate Tamil and English routes, generate each route’s title, description, URL, image, language, and locale from that route’s own content.
3. Choose and serve the share image
Open Graph does not prescribe one image size that guarantees identical rendering on every platform. A practical starting point is a landscape image around 1200×630 pixels. Netlify gives 1200×630 as a recommended example, while Webflow reports Facebook guidance of at least 1080 pixels in width. Treat these as practical guidance, then check the current requirements for the services your readers use.
- Use a high-resolution image with a moderate landscape aspect ratio.
- Make the image relevant to the specific page. Google recommends against generic images and text-heavy artwork for Google image previews; Google may select an image from multiple sources, so
og:imagecannot guarantee its choice. - Provide a descriptive
og:image:alt. The Open Graph protocol says pages specifyingog:imageshould also specify image alt text. - When known, declare image width, height, and MIME type. These optional properties describe the asset; ensure they agree with the actual file.
- Use a commonly supported raster format if cross-platform reliability matters. JPG and PNG have broad practical support; WebP support varies by platform and tooling.
- Make sure the image URL is publicly accessible to crawlers. Check that it does not require login, a temporary cookie, or a short-lived signed URL.
For Google image guidance, see Google’s documentation on image SEO. Platform image handling can differ, so validate the image on the services that matter to your audience.
4. Generate metadata per route
In a server-rendered site, shared layout, or CMS, map each page’s data into one set of tags. The rendered HTML response should contain the metadata in the head so a crawler can read it without relying on client-side interaction.
function escapeAttribute(value) {
return String(value)
.replaceAll('&', '&')
.replaceAll('"', '"')
.replaceAll('<', '<')
.replaceAll('>', '>');
}
function socialHead(page) {
const fields = {
title: escapeAttribute(page.title),
description: escapeAttribute(page.description),
url: escapeAttribute(page.canonicalUrl),
image: escapeAttribute(page.imageUrl),
imageAlt: escapeAttribute(page.imageAlt),
locale: escapeAttribute(page.locale)
};
return `<title>${fields.title}</title>
<link rel="canonical" href="${fields.url}">
<meta property="og:type" content="article">
<meta property="og:title" content="${fields.title}">
<meta property="og:description" content="${fields.description}">
<meta property="og:url" content="${fields.url}">
<meta property="og:image" content="${fields.image}">
<meta property="og:image:alt" content="${fields.imageAlt}">
<meta property="og:locale" content="${fields.locale}">
<meta name="twitter:card" content="summary_large_image">`;
}
const tamilArticle = {
title: 'தமிழ் பக்கத் தலைப்பு',
description: 'இந்தப் பக்கத்தைப் பற்றிய சுருக்கமான விளக்கம்.',
canonicalUrl: 'https://example.com/ta/article/',
imageUrl: 'https://example.com/images/ta-article-share.jpg',
imageAlt: 'பக்கத்தின் உள்ளடக்கத்தை பிரதிபலிக்கும் படம்',
locale: 'ta_IN'
};
// Insert socialHead(tamilArticle) into the server-rendered HTML <head>.
This JavaScript example illustrates safe attribute escaping and route data mapping; it is not tied to a particular web framework. In production, use the framework’s HTML templating or metadata API, which should escape values appropriately. Avoid emitting a second copy of the same tags from a plugin or CMS field.
Netlify documents shared layouts, and Webflow documents per-page and dynamic collection metadata. A shared template works when each route supplies unique values; CMS-native fields work when editors need to maintain those values themselves. See Netlify documentation and Webflow help for their respective approaches.
5. Verify the deployed page and image
- Deploy the page and open its public URL.
- Inspect the delivered page source or fetched HTML. Confirm there is one intended value for each Open Graph property and that all values belong to this route.
- Open the
og:imageURL directly in a private browser window. Confirm the response serves the image without authentication or an expired redirect. - Check that the declared MIME type and dimensions match the real file, if you included those optional tags.
- Use the target platform’s preview or scrape refresh tool. Webflow documents Meta’s debugger, LinkedIn’s Post Inspector, and X’s Card Validator. Re-scrape after changing metadata or the image if the platform offers that option.
- Check each important platform independently. Preview rendering and refresh behavior can differ.
For a quick inspection of the delivered HTML and screenshot of a public page, ScreenshotNeo can capture the page. A screenshot helps check the visible page layout; inspect the HTML source separately to verify metadata in the head.
6. Common problems and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| Preview has a title but no image | og:image is missing, points to the wrong file, or the crawler cannot fetch it. |
Set the absolute public image URL, open it without a logged-in session, and use a supported image format. Refresh the platform scrape. |
| An old image remains after an update | The service is showing a cached scrape or image. | Use that service’s debugger or re-scrape workflow where available. Confirm the deployed page and image URL have changed as intended. |
| A different route’s title or image appears | Shared metadata is hard-coded, route data is wrong, or multiple templates emit duplicate tags. | Generate values from the current route’s content and canonical URL. Remove duplicate metadata from the CMS, plugin, or layout. |
| The image URL works for me but not in a preview | The asset is private, redirects through a login, uses a short-lived URL, or blocks the crawler. | Serve it at a stable public URL and check the response without browser-only cookies. |
| Tamil characters appear incorrectly | The document encoding is missing or the metadata string is damaged during template rendering. | Declare UTF-8, preserve Tamil text in the source data, and inspect the final rendered HTML rather than only the editor fields. |
| Every page shows the same preview | The template uses fixed site-wide values instead of page-specific fields. | Bind title, description, canonical URL, and image to each page or CMS record. |
Google shows an image other than og:image |
Google’s image selection is automated and may use other page or image signals. | Use a relevant, crawlable image and follow Google’s image guidance. Treat the Open Graph image as an input, not a guarantee. |
| Previews differ between social services | Each service parses and displays metadata independently. | Validate each service your audience uses and follow its current preview guidance. |
7. Reliability, performance, and cost considerations
Social preview creation depends on a crawler fetching the HTML and the image. Keep both available at stable public URLs, emit metadata in the delivered head, and avoid making preview correctness depend on client-side code. A route-specific template also reduces editorial mistakes, but only if every route has complete data.
The tags add a small amount of HTML; the image fetch is the larger asset consideration. Reuse a stable page image URL until the image changes, and keep file dimensions appropriate for the target platforms. When replacing an image at the same URL, a platform may continue to show a cached copy, so use its scrape refresh tool when available.
This implementation uses HTML and an image asset; no screenshot API is required to add the metadata. If you do use a screenshot service to inspect public page appearance, usage and pricing depend on the provider and capture settings. ScreenshotNeo bills only clean shots; bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses report the page verdict and billing status in headers. Its free plan includes 1,000 shots a month without a card; paid plans start at $5 for 3,000 shots. See the ScreenshotNeo docs for request options and the ScreenshotNeo site for plan details.
8. Or skip the browser setup
If you need a rendered screenshot while checking a deployed page, ScreenshotNeo takes a screenshot with one GET request. This does not replace checking the HTML head for tag values.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/ta/article/ -o shot.webp
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://example.com/ta/article/"},
timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://example.com/ta/article/'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await Bun.write('shot.webp', res); // Bun runtime
For Node.js, save the returned bytes with Node’s filesystem API:
import { writeFile } from 'node:fs/promises';
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://example.com/ta/article/'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));
Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. See the API docs for options. Sign up for 1,000 free screenshots a month, with no card required.
Frequently asked questions
Does adding Open Graph tags guarantee every service uses my image?
No. The tags tell services which image to consider, but each service fetches and renders previews independently. Google explicitly says image selection is automated.
Should the Tamil page use ta or ta_IN?
Use ta for the HTML lang attribute. Use a language-and-territory value such as ta_IN for Open Graph locale only when it matches the page’s intended audience.
Can I use one share image across the whole site?
You can, but page-relevant images give each URL a more representative preview. At minimum, ensure each page’s title, description, and URL are unique.
Do I need a screenshot API to add sharing images?
No. The core implementation is page metadata plus a public image asset. A screenshot API can help inspect rendered appearance, but it does not add Open Graph tags for you.
Implementation checklist
htmlhaslang="ta".- Each route has its own Tamil title, description, canonical URL, and image URL.
og:imageis an absolute, public URL and the image matches the declared format and dimensions.og:image:altdescribes the image.og:localereflects the intended territory.- The deployed HTML has no duplicate or stale tags.
- Important social services have been checked or re-scraped after updates.


