Meta Tag and Open Graph Preview Checker for SEO and Social Sharing

CodeZips SEO Utility

Meta Tag and Open Graph Preview Checker

Paste the head HTML from a webpage and check your SEO title, meta description, canonical tag, robots meta tag, Open Graph tags, Twitter/X card tags, favicon, viewport and schema presence. Get a plain-English audit report plus search and social preview mockups.

SEO title check Meta description check Open Graph preview Robots and canonical audit
Use this when a page looks wrong in Google, Facebook, LinkedIn, X, Slack or messaging previews.
  • Extract important head tags from pasted HTML.
  • Find missing and duplicate SEO tags.
  • Preview search and social snippets.
  • Copy a clean technical SEO report.

Analyze pasted head HTML

Paste your page head HTML or full page HTML. This tool extracts common SEO and social tags locally in your browser and creates a readable report. It does not fetch live URLs.

Privacy note: this tool runs in your browser. Your pasted HTML and URLs are not uploaded by this page.
Try a meta tag example:
Score 0/100
Issues 0
OG tags 0
Schema 0
example.com/page/
Search preview title will appear here
Meta description preview will appear here after you analyze the pasted HTML.
Open Graph image preview area
example.com
Social title will appear here
Social description preview will appear here.
Paste HTML and run the checker to see SEO and social preview notes.

What this meta tag and Open Graph checker does

A webpage can have useful content but still look weak in search results, social shares, chat previews and bookmarks because the head tags are missing, duplicated or inconsistent. The title may be too vague. The meta description may be missing. The canonical tag may point to the wrong URL. A robots tag may accidentally say noindex. Open Graph tags may be absent, which can make Facebook, LinkedIn, Slack and other preview surfaces guess the wrong title or image. Twitter or X card tags may be missing, which can make shared links look unfinished.

This tool helps you inspect those head tags without fetching a live URL. Paste the head HTML or full page HTML into the box and the checker extracts common SEO, Open Graph, Twitter/X, favicon, viewport and JSON-LD tags. It then creates a plain-English audit report, a simple Google-style preview, a social-card-style preview, and a list of missing or duplicate issues. Because it runs in your browser, it is useful when you are working on a draft page, local HTML file, WordPress Custom HTML page, staging page or copied page source.

This is not an official Google preview generator and it does not promise exactly how any platform will display your page. Search engines and social platforms may rewrite titles, choose different snippets or cache old previews. The value of this tool is practical debugging: it helps you see whether your page gives platforms a clean title, description, canonical URL, robots instruction and social preview data to work with.

Best use: paste the final rendered head HTML from your page source when possible. If a plugin, theme or JavaScript changes tags after editing, the source you paste should match what visitors and crawlers are likely to see.

Why meta tags matter for SEO and sharing

Meta tags do not magically make a weak page rank. They are better understood as clarity signals and presentation helpers. A strong title helps users and search systems understand what the page is about. A useful meta description gives search engines a candidate summary for snippets. A canonical tag helps communicate the preferred URL when similar or duplicate pages exist. A robots meta tag can allow or restrict indexing and following behavior. Open Graph and Twitter/X card tags help social platforms build richer previews.

Google can generate title links from several page signals and may not always use the exact title tag you wrote. Google also may use the meta description for snippets when it believes the description is a good match for the query and page content. That means your job is not to force a preview, but to write clear tags that accurately represent the page. If the title, description and on-page content disagree, platforms may ignore or rewrite what you provided.

For WordPress users, this matters because themes and plugins can create duplicate or conflicting tags. An SEO plugin may output one canonical tag while a theme or custom snippet outputs another. A social plugin may create Open Graph tags, but the image URL might be missing or relative. A noindex setting might remain active after testing. This tool helps you catch those problems before publishing or while troubleshooting a page that looks wrong in search and social previews.

What the checker looks for

Tag or signal Why it matters Common issue
Title tag Gives the page a primary title candidate for browsers and search results. Missing, duplicated, too generic, too long, or not aligned with the page content.
Meta description Gives search engines a candidate snippet summary for the page. Missing, duplicated, stuffed with keywords, too vague, or copied across many pages.
Canonical link Suggests the preferred URL when similar URLs exist. Missing on important pages, relative when absolute is safer, or pointing to the wrong page.
Robots meta Can control index and follow behavior for supported crawlers. Accidental noindex on a page you want indexed.
Open Graph tags Help social platforms create link previews with title, description, URL, type and image. Missing image, missing description, old image, relative image URL, or mismatch with SEO title.
Twitter/X card tags Help X-compatible card previews understand card type, title, description and image. Missing card type, title, description or image.
Favicon and app icons Help browsers, tabs, bookmarks and devices identify the page or site. Missing favicon or only one icon size available.
JSON-LD schema Can help search systems understand page entities and structured data when valid and appropriate. Invalid JSON-LD, wrong type, duplicate schema, or schema that does not match visible content.

How to use this tool step by step

  1. Open your page source or view rendered HTML. In WordPress, this might come from viewing the public page source after your SEO plugin and theme have generated the final tags.
  2. Copy the head section. You can paste only the head HTML or the full HTML document. The tool will try to parse both.
  3. Add the page URL. This helps the preview and canonical checks compare the visible page URL with the tags you pasted.
  4. Run the analysis. Review the score, issues, search preview, social preview and full audit report.
  5. Fix one issue at a time. Start with accidental noindex, missing title, missing description, wrong canonical and missing Open Graph image before polishing smaller details.
  6. Preview the real page again. After changing a plugin setting or theme template, view the final page source again because WordPress can output different tags than the editor screen suggests.

If your tags contain encoded URLs or unusual characters, inspect them carefully before publishing. The CodeZips URL Encoder and Decoder can help you understand encoded URLs inside canonical, image or redirect values. If you copied a social URL that includes tracking parameters, the CodeZips URL Parameter Cleaner can help you clean the URL before using it as a canonical or share link candidate.

Good meta tag examples

A good head section is not about stuffing every possible tag into the page. It is about giving crawlers, browsers and social platforms enough accurate information to understand the page. A simple useful page might include a clear title, a specific meta description, a canonical URL, normal robots behavior, Open Graph preview tags, Twitter/X card tags, a favicon and structured data if the page actually supports it.

URL Encoder and Decoder Tool for Developers







Notice that the title and description are specific. The canonical uses the clean final URL. The social title and description match the page topic. The Open Graph image uses an absolute URL. These small details help avoid confusing previews and duplicate URL signals.

Common mistakes this checker can catch

Accidental noindex

A noindex tag is powerful. If you see on a page that should appear in search, treat it as a priority issue. This can happen after using a staging setting, SEO plugin checkbox, template condition or site-wide privacy setting.

Duplicate titles and descriptions

Duplicate meta tags can happen when a theme and plugin both output the same type of tag. Search engines and social platforms then need to decide which one to trust. Even when duplicates do not break the page, they make debugging harder. A clean page should usually have one main title tag, one meta description and one canonical tag.

Missing Open Graph image

A page can have a strong SEO title and description but still look poor when shared because no image is provided. Open Graph image tags are especially important for visual previews in social feeds, messaging apps and workplace chat tools. Use an absolute image URL and test the final preview after publishing.

Canonical URL points to the wrong page

Canonical tags are often overlooked because they are invisible to normal users. If a page canonicalizes to another URL, search engines may choose the other URL as the preferred version. That may be correct for duplicates, but harmful if you accidentally canonicalize a new page to an old page or homepage.

Using meta keywords for Google SEO

The old meta keywords tag is not a useful modern Google ranking tool. It can still appear on old sites, but it should not be treated as a priority SEO field. Focus on helpful content, crawlable links, clear titles, useful descriptions, canonical correctness and strong internal linking instead.

WordPress and blogger workflow

For a WordPress site, the best workflow is to check the public page after your SEO plugin, theme and cache have all generated the final source. The editor screen may show one title, while the final page source includes a different title template. A plugin may add Open Graph tags, while a theme adds another set. A caching plugin may keep an older preview image. A social platform may also cache old metadata for a while after you update the page.

When you write technical content, you may also need to display meta tag examples in the article itself. If you paste raw tags into WordPress, the browser may interpret them. Use the CodeZips HTML Entity Encoder and Decoder when you need meta tag examples to display safely as text. If your article includes JSON-LD examples, the CodeZips JSON Formatter and Validator can help check the JSON structure before you escape it for display.

If your title or description contains query strings, redirect URLs, campaign URLs or API examples, inspect the URL pieces before publishing. The CodeZips Query String Parser and Builder is helpful for understanding individual parameters. The CodeZips UTM URL Builder and Campaign Link Checker is better when you are building campaign links intentionally rather than using a clean canonical URL.

Troubleshooting wrong social previews

If your page looks wrong when shared on Facebook, LinkedIn, Slack, X, Discord or messaging apps, check four things first: whether Open Graph tags exist, whether the image URL is absolute and accessible, whether the title and description match the page, and whether the platform is using a cached preview from before your latest update. Many preview problems are not caused by the visible page content. They are caused by missing, stale or conflicting metadata.

If the social preview shows the wrong image, look for multiple og:image tags and confirm which one appears first. If the title is wrong, compare the title tag, og:title and Twitter/X title. If the URL is wrong, check og:url and canonical. If the preview shows no description, check both meta description and og:description. If the image is relative, convert it to a full absolute URL.

Also remember that social platforms may cache metadata. After fixing tags, you may need to use that platform’s own sharing debugger, cache refresh tool or simply wait for the cache to update. This CodeZips tool helps you inspect the HTML, but it does not purge any third-party social cache.

When to use this tool vs related CodeZips tools

FAQ

Does this meta tag checker fetch my live URL?

No. This tool analyzes the HTML you paste into the page. It does not crawl your website, fetch a live URL, call a backend or contact social platforms.

Can this tool show the exact Google search result?

No. The preview is an approximation for debugging. Google may rewrite titles or snippets based on the query, page content, device and its own systems.

Why is my meta description not showing in Google?

Google may choose a different snippet if it believes on-page text better matches the search query. A meta description is a candidate summary, not a guaranteed display.

What Open Graph tags should a page usually have?

A practical starting set includes og:title, og:description, og:url, og:type and og:image. Some pages may need additional image width, image height, site name or locale tags.

What does a noindex robots meta tag mean?

A noindex robots meta tag tells supported search engines not to include the page in search results. If the page should be indexed, accidental noindex is a priority issue.

Should canonical URLs include UTM parameters?

Usually no. Canonical URLs should normally point to the clean preferred version of a page, not campaign tracking variations.

Why does my social preview show the wrong image?

The page may have no og:image, a relative image URL, multiple conflicting image tags, an inaccessible image, or a cached social preview from an older version of the page.

Does Google use the meta keywords tag?

The meta keywords tag should not be treated as a useful Google ranking field. Focus on clear content, title, description, canonical, crawlability and internal links instead.

Can this tool validate schema markup fully?

No. It detects JSON-LD scripts and tries to identify schema types, but it is not a full structured data validator. Use dedicated structured data testing tools for final validation.

Can I use this for WordPress SEO plugins?

Yes. View the final public page source after your theme and SEO plugin generate tags, then paste that head HTML into this tool. That is usually more useful than checking only plugin settings.

Final practical note

Meta tags work best when they accurately support the real page. A clear title, useful description, correct canonical URL, normal robots instruction and complete social preview tags can make a page easier to understand and share. They cannot replace helpful content, good internal links or a page that deserves to be indexed. Use this checker to catch technical mistakes, then improve the page itself.

' }, missing: { url: "https://example.com/blog/meta-tags/", html: 'Meta Tags\n\n\n' }, noindex: { url: "https://example.com/tools/new-tool/", html: 'New Tool Page for SEO Testing\n\n\n\n\n\n' }, duplicate: { url: "https://example.com/page/", html: 'First Title\nSecond Title\n\n\n\n\n\n\n' } }; function parseHtml(raw) { var text = raw || ""; var hasHtml = /]/i.test(text) || /]/i.test(text) || /" + text + ""; var parser = new DOMParser(); return parser.parseFromString(source, "text/html"); } function attr(el, name) { return el ? (el.getAttribute(name) || "").trim() : ""; } function text(el) { return el ? (el.textContent || "").trim() : ""; } function all(doc, selector) { return Array.prototype.slice.call(doc.querySelectorAll(selector)); } function firstMeta(doc, key, value) { var selector = 'meta[' + key + '="' + value + '"]'; return doc.querySelector(selector); } function metaContent(doc, key, value) { return attr(firstMeta(doc, key, value), "content"); } function linkHref(doc, rel) { var links = all(doc, "link[rel]"); for (var i = 0; i < links.length; i++) { var relValue = attr(links[i], "rel").toLowerCase(); if (relValue.split(/\s+/).indexOf(rel.toLowerCase()) !== -1) { return attr(links[i], "href"); } } return ""; } function getLinksByRel(doc, rel) { return all(doc, "link[rel]").filter(function (link) { return attr(link, "rel").toLowerCase().split(/\s+/).indexOf(rel.toLowerCase()) !== -1; }); } function getMetaList(doc, key, value) { return all(doc, 'meta[' + key + '="' + value + '"]'); } function getOgTags(doc) { var tags = {}; var list = all(doc, "meta[property]"); list.forEach(function (el) { var property = attr(el, "property"); if (property.toLowerCase().indexOf("og:") === 0) { if (!tags[property]) tags[property] = []; tags[property].push(attr(el, "content")); } }); return tags; } function getTwitterTags(doc) { var tags = {}; var list = all(doc, "meta[name]"); list.forEach(function (el) { var name = attr(el, "name"); if (name.toLowerCase().indexOf("twitter:") === 0) { if (!tags[name]) tags[name] = []; tags[name].push(attr(el, "content")); } }); return tags; } function getJsonLd(doc) { var scripts = all(doc, 'script[type="application/ld+json"]'); return scripts.map(function (script, index) { var raw = script.textContent || ""; var type = "Unknown"; var valid = true; var error = ""; try { var parsed = JSON.parse(raw); if (Array.isArray(parsed)) { type = parsed.map(function (item) { return item && item["@type"] ? item["@type"] : "Unknown"; }).join(", "); } else if (parsed && parsed["@graph"] && Array.isArray(parsed["@graph"])) { type = parsed["@graph"].map(function (item) { return item && item["@type"] ? item["@type"] : "Unknown"; }).join(", "); } else if (parsed && parsed["@type"]) { type = parsed["@type"]; } } catch (e) { valid = false; error = e.message; } return { index: index + 1, type: type, valid: valid, error: error }; }); } function safeLen(value) { return (value || "").trim().length; } function absoluteUrl(value, pageUrl) { if (!value) return ""; try { if (pageUrl) { return new URL(value, pageUrl).href; } return new URL(value).href; } catch (e) { return value; } } function hostname(value) { try { return new URL(value).hostname.replace(/^www\./, ""); } catch (e) { return "example.com"; } } function normalizePageUrl() { var value = (pageUrlInput.value || "").trim(); if (!value) return ""; try { if (!/^https?:\/\//i.test(value)) value = "https://" + value; return new URL(value).href; } catch (e) { return value; } } function addIssue(issues, severity, message) { issues.push({ severity: severity, message: message }); } function analyze() { var raw = htmlInput.value || ""; var pageUrl = normalizePageUrl(); var doc = parseHtml(raw); var titleEls = all(doc, "title"); var title = titleEls.length ? text(titleEls[0]) : ""; var descList = getMetaList(doc, "name", "description"); var description = descList.length ? attr(descList[0], "content") : ""; var canonicalLinks = getLinksByRel(doc, "canonical"); var canonical = canonicalLinks.length ? attr(canonicalLinks[0], "href") : ""; var robotsList = getMetaList(doc, "name", "robots"); var robots = robotsList.length ? attr(robotsList[0], "content") : ""; var googlebot = metaContent(doc, "name", "googlebot"); var viewport = metaContent(doc, "name", "viewport"); var charset = attr(doc.querySelector("meta[charset]"), "charset"); var keywords = metaContent(doc, "name", "keywords"); var favicon = linkHref(doc, "icon") || linkHref(doc, "shortcut icon") || linkHref(doc, "apple-touch-icon"); var og = getOgTags(doc); var twitter = getTwitterTags(doc); var jsonLd = getJsonLd(doc); var titleMin = parseInt(titleMinInput.value, 10) || 25; var titleMax = parseInt(titleMaxInput.value, 10) || 65; var descMin = parseInt(descMinInput.value, 10) || 70; var descMax = parseInt(descMaxInput.value, 10) || 160; var issues = []; if (!raw.trim()) addIssue(issues, "High", "No HTML was pasted."); if (!title) addIssue(issues, "High", "Missing title tag."); if (titleEls.length > 1) addIssue(issues, "Medium", "Multiple title tags found: " + titleEls.length + "."); if (title && safeLen(title) < titleMin) addIssue(issues, "Low", "Title is short based on your warning setting: " + safeLen(title) + " characters."); if (title && safeLen(title) > titleMax) addIssue(issues, "Medium", "Title is long based on your warning setting: " + safeLen(title) + " characters."); if (!description) addIssue(issues, "High", "Missing meta description."); if (descList.length > 1) addIssue(issues, "Medium", "Multiple meta description tags found: " + descList.length + "."); if (description && safeLen(description) < descMin) addIssue(issues, "Low", "Meta description is short based on your warning setting: " + safeLen(description) + " characters."); if (description && safeLen(description) > descMax) addIssue(issues, "Medium", "Meta description is long based on your warning setting: " + safeLen(description) + " characters."); if (!canonical) addIssue(issues, "Medium", "Missing canonical link tag."); if (canonicalLinks.length > 1) addIssue(issues, "High", "Multiple canonical tags found: " + canonicalLinks.length + "."); if (canonical && !/^https?:\/\//i.test(canonical)) addIssue(issues, "Low", "Canonical URL appears relative. An absolute URL is usually clearer."); if (pageUrl && canonical && /^https?:\/\//i.test(canonical)) { try { var pageObj = new URL(pageUrl); var canonObj = new URL(canonical); if (pageObj.hostname.replace(/^www\./, "") !== canonObj.hostname.replace(/^www\./, "")) { addIssue(issues, "Medium", "Canonical points to a different hostname than the page URL."); } } catch (e) {} } if (robotsList.length > 1) addIssue(issues, "Medium", "Multiple robots meta tags found: " + robotsList.length + "."); if (robots.toLowerCase().indexOf("noindex") !== -1 || googlebot.toLowerCase().indexOf("noindex") !== -1) { addIssue(issues, "High", "Noindex detected. This page may be excluded from supported search indexes."); } if (robots.toLowerCase().indexOf("nofollow") !== -1 || googlebot.toLowerCase().indexOf("nofollow") !== -1) { addIssue(issues, "Medium", "Nofollow detected in robots instructions."); } if (!viewport) addIssue(issues, "Low", "Missing viewport meta tag. This can affect mobile layout."); if (!favicon) addIssue(issues, "Low", "No favicon or app icon link detected."); if (keywords) addIssue(issues, "Low", "Meta keywords tag found. Do not treat it as an important Google ranking field."); if (!og["og:title"]) addIssue(issues, "Medium", "Missing og:title."); if (!og["og:description"]) addIssue(issues, "Medium", "Missing og:description."); if (!og["og:image"]) addIssue(issues, "Medium", "Missing og:image."); if (!og["og:url"]) addIssue(issues, "Low", "Missing og:url."); if (!og["og:type"]) addIssue(issues, "Low", "Missing og:type."); Object.keys(og).forEach(function (key) { if (og[key].length > 1 && ["og:title", "og:description", "og:url", "og:type"].indexOf(key) !== -1) { addIssue(issues, "Medium", "Duplicate " + key + " tags found: " + og[key].length + "."); } }); if (og["og:image"] && og["og:image"][0] && !/^https?:\/\//i.test(og["og:image"][0])) { addIssue(issues, "Medium", "og:image appears relative. Social previews usually work better with absolute image URLs."); } if (!twitter["twitter:card"]) addIssue(issues, "Low", "Missing twitter:card / X card type."); if (!twitter["twitter:title"] && !og["og:title"]) addIssue(issues, "Low", "No Twitter/X title and no og:title fallback detected."); if (!twitter["twitter:description"] && !og["og:description"]) addIssue(issues, "Low", "No Twitter/X description and no og:description fallback detected."); if (!twitter["twitter:image"] && !og["og:image"]) addIssue(issues, "Low", "No Twitter/X image and no og:image fallback detected."); jsonLd.forEach(function (item) { if (!item.valid) addIssue(issues, "Medium", "JSON-LD script " + item.index + " is invalid: " + item.error); }); var high = issues.filter(function (item) { return item.severity === "High"; }).length; var medium = issues.filter(function (item) { return item.severity === "Medium"; }).length; var low = issues.filter(function (item) { return item.severity === "Low"; }).length; var score = Math.max(0, 100 - high * 18 - medium * 9 - low * 3); var ogCount = Object.keys(og).reduce(function (sum, key) { return sum + og[key].length; }, 0); scoreOut.textContent = score + "/100"; issuesOut.textContent = issues.length; ogCountOut.textContent = ogCount; schemaCountOut.textContent = jsonLd.length; var displayUrl = pageUrl || canonical || (og["og:url"] ? og["og:url"][0] : "https://example.com/page/"); var displayTitle = title || (og["og:title"] ? og["og:title"][0] : "Missing title"); var displayDesc = description || (og["og:description"] ? og["og:description"][0] : "Missing meta description."); var displayHost = hostname(displayUrl); var socialT = (og["og:title"] && og["og:title"][0]) || (twitter["twitter:title"] && twitter["twitter:title"][0]) || title || "Missing social title"; var socialD = (og["og:description"] && og["og:description"][0]) || (twitter["twitter:description"] && twitter["twitter:description"][0]) || description || "Missing social description."; var socialImg = (og["og:image"] && og["og:image"][0]) || (twitter["twitter:image"] && twitter["twitter:image"][0]) || ""; previewUrl.textContent = displayHost + new URLFallbackPath(displayUrl); previewTitle.textContent = displayTitle; previewDesc.textContent = displayDesc; socialDomain.textContent = displayHost; socialTitle.textContent = socialT; socialDesc.textContent = socialD; socialImage.textContent = socialImg ? absoluteUrl(socialImg, pageUrl) : "No Open Graph image found"; var report = buildReport({ score: score, issues: issues, title: title, titleCount: titleEls.length, description: description, descriptionCount: descList.length, canonical: canonical, canonicalCount: canonicalLinks.length, robots: robots, googlebot: googlebot, viewport: viewport, charset: charset, keywords: keywords, favicon: favicon, og: og, twitter: twitter, jsonLd: jsonLd, pageUrl: pageUrl, outputMode: outputMode.value }); reportOut.value = report; warningsOut.textContent = buildWarningText(issues); } function URLFallbackPath(value) { try { var url = new URL(value); return url.pathname === "/" ? "/" : url.pathname; } catch (e) { return "/page/"; } } function tagLine(label, value) { return "- " + label + ": " + (value ? value : "Missing"); } function listObjectTags(obj) { var lines = []; var keys = Object.keys(obj).sort(); if (!keys.length) { lines.push("- None found"); } else { keys.forEach(function (key) { obj[key].forEach(function (value) { lines.push("- " + key + ": " + value); }); }); } return lines; } function buildReport(data) { var mode = data.outputMode; var lines = []; if (mode === "missing") { lines.push("MISSING AND DUPLICATE META ISSUES"); lines.push("================================="); lines.push(""); if (!data.issues.length) { lines.push("No major missing or duplicate issues detected from the pasted HTML."); } else { data.issues.forEach(function (issue) { lines.push("- [" + issue.severity + "] " + issue.message); }); } return lines.join("\n"); } if (mode === "extract") { lines.push("EXTRACTED META TAG SUMMARY"); lines.push("=========================="); lines.push(""); lines.push(tagLine("Page URL", data.pageUrl)); lines.push(tagLine("Title", data.title)); lines.push(tagLine("Meta description", data.description)); lines.push(tagLine("Canonical", data.canonical)); lines.push(tagLine("Robots", data.robots)); lines.push(tagLine("Googlebot", data.googlebot)); lines.push(tagLine("Viewport", data.viewport)); lines.push(tagLine("Charset", data.charset)); lines.push(tagLine("Favicon", data.favicon)); lines.push(""); lines.push("Open Graph tags"); listObjectTags(data.og).forEach(function (line) { lines.push(line); }); lines.push(""); lines.push("Twitter/X card tags"); listObjectTags(data.twitter).forEach(function (line) { lines.push(line); }); lines.push(""); lines.push("JSON-LD schema"); if (!data.jsonLd.length) { lines.push("- None found"); } else { data.jsonLd.forEach(function (item) { lines.push("- Script " + item.index + ": " + item.type + " (" + (item.valid ? "valid JSON" : "invalid JSON") + ")"); }); } return lines.join("\n"); } if (mode === "social") { lines.push("SOCIAL PREVIEW CHECKLIST"); lines.push("========================"); lines.push(""); lines.push("Open Graph"); lines.push(tagLine("og:title", data.og["og:title"] ? data.og["og:title"][0] : "")); lines.push(tagLine("og:description", data.og["og:description"] ? data.og["og:description"][0] : "")); lines.push(tagLine("og:url", data.og["og:url"] ? data.og["og:url"][0] : "")); lines.push(tagLine("og:type", data.og["og:type"] ? data.og["og:type"][0] : "")); lines.push(tagLine("og:image", data.og["og:image"] ? data.og["og:image"][0] : "")); lines.push(""); lines.push("Twitter/X card"); lines.push(tagLine("twitter:card", data.twitter["twitter:card"] ? data.twitter["twitter:card"][0] : "")); lines.push(tagLine("twitter:title", data.twitter["twitter:title"] ? data.twitter["twitter:title"][0] : "")); lines.push(tagLine("twitter:description", data.twitter["twitter:description"] ? data.twitter["twitter:description"][0] : "")); lines.push(tagLine("twitter:image", data.twitter["twitter:image"] ? data.twitter["twitter:image"][0] : "")); lines.push(""); lines.push("Social preview notes"); data.issues.filter(function (issue) { return issue.message.toLowerCase().indexOf("og:") !== -1 || issue.message.toLowerCase().indexOf("twitter") !== -1 || issue.message.toLowerCase().indexOf("image") !== -1; }).forEach(function (issue) { lines.push("- [" + issue.severity + "] " + issue.message); }); return lines.join("\n"); } lines.push("META TAG AND OPEN GRAPH AUDIT REPORT"); lines.push("===================================="); lines.push(""); lines.push("Score"); lines.push("- " + data.score + "/100"); lines.push("- Issues found: " + data.issues.length); lines.push(""); lines.push("Core SEO tags"); lines.push(tagLine("Page URL", data.pageUrl)); lines.push(tagLine("Title", data.title)); lines.push("- Title count: " + data.titleCount); lines.push("- Title length: " + (data.title ? data.title.length : 0) + " characters"); lines.push(tagLine("Meta description", data.description)); lines.push("- Meta description count: " + data.descriptionCount); lines.push("- Meta description length: " + (data.description ? data.description.length : 0) + " characters"); lines.push(tagLine("Canonical", data.canonical)); lines.push("- Canonical count: " + data.canonicalCount); lines.push(tagLine("Robots", data.robots)); lines.push(tagLine("Googlebot", data.googlebot)); lines.push(tagLine("Viewport", data.viewport)); lines.push(tagLine("Charset", data.charset)); lines.push(tagLine("Favicon", data.favicon)); lines.push(""); lines.push("Open Graph tags"); listObjectTags(data.og).forEach(function (line) { lines.push(line); }); lines.push(""); lines.push("Twitter/X card tags"); listObjectTags(data.twitter).forEach(function (line) { lines.push(line); }); lines.push(""); lines.push("JSON-LD schema"); if (!data.jsonLd.length) { lines.push("- None found"); } else { data.jsonLd.forEach(function (item) { lines.push("- Script " + item.index + ": " + item.type + " (" + (item.valid ? "valid JSON" : "invalid JSON") + ")"); if (item.error) lines.push(" Error: " + item.error); }); } lines.push(""); lines.push("Issues and warnings"); if (!data.issues.length) { lines.push("- No major issue detected from the pasted HTML."); } else { data.issues.forEach(function (issue) { lines.push("- [" + issue.severity + "] " + issue.message); }); } lines.push(""); lines.push("Recommended next steps"); lines.push("1. Fix accidental noindex, missing title, missing description, wrong canonical and missing social image first."); lines.push("2. Check the final public page source after WordPress plugins, themes and cache have generated the page."); lines.push("3. Use absolute URLs for canonical and social image tags when possible."); lines.push("4. Keep the title, meta description, Open Graph title and page content aligned."); lines.push("5. Test final social previews with platform-specific debugging tools if the preview is cached."); return lines.join("\n"); } function buildWarningText(issues) { if (!issues.length) { return "No major warning detected from the pasted HTML. Still preview the final public page after publishing."; } return issues.slice(0, 12).map(function (issue) { return "- [" + issue.severity + "] " + issue.message; }).join("\n"); } function resetTool() { htmlInput.value = ""; pageUrlInput.value = ""; outputMode.value = "audit"; titleMinInput.value = "25"; titleMaxInput.value = "65"; descMinInput.value = "70"; descMaxInput.value = "160"; scoreOut.textContent = "0/100"; issuesOut.textContent = "0"; ogCountOut.textContent = "0"; schemaCountOut.textContent = "0"; previewUrl.textContent = "example.com/page/"; previewTitle.textContent = "Search preview title will appear here"; previewDesc.textContent = "Meta description preview will appear here after you analyze the pasted HTML."; socialImage.textContent = "Open Graph image preview area"; socialDomain.textContent = "example.com"; socialTitle.textContent = "Social title will appear here"; socialDesc.textContent = "Social description preview will appear here."; reportOut.value = "Your meta tag, Open Graph and SEO audit report will appear here."; warningsOut.textContent = "Paste HTML and run the checker to see SEO and social preview notes."; } function copyReport() { var text = reportOut.value; if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(text).then(function () { copyBtn.textContent = "Copied"; setTimeout(function () { copyBtn.textContent = "Copy Report"; }, 1200); }); } else { reportOut.focus(); reportOut.select(); document.execCommand("copy"); copyBtn.textContent = "Copied"; setTimeout(function () { copyBtn.textContent = "Copy Report"; }, 1200); } } function downloadReport() { var blob = new Blob([reportOut.value], { type: "text/plain;charset=utf-8" }); var url = URL.createObjectURL(blob); var link = document.createElement("a"); link.href = url; link.download = "meta-tag-open-graph-audit-report.txt"; document.body.appendChild(link); link.click(); document.body.removeChild(link); URL.revokeObjectURL(url); } analyzeBtn.addEventListener("click", analyze); resetBtn.addEventListener("click", resetTool); copyBtn.addEventListener("click", copyReport); downloadBtn.addEventListener("click", downloadReport); document.querySelectorAll(".cz-meta-example").forEach(function (button) { button.addEventListener("click", function () { var item = examples[button.getAttribute("data-example")]; if (!item) return; pageUrlInput.value = item.url; htmlInput.value = item.html; analyze(); }); }); })();

Leave a Comment

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

Scroll to Top