Fixing incorrect social preview metadata on WordPress after page duplication

Overview

After duplicating a WordPress page for a new program launch, the client noticed that the social media preview image and description were still pulling from the old version of the page, even though the content, title, and Yoast SEO settings had been updated. Clearing cache and toggling lazy load didn’t fix the issue.

This case study outlines how Freshy identified the source of the incorrect metadata and corrected the preview information by updating hardcoded Open Graph (OG) tags within the page’s template.

Issue background

The client created a new program page by duplicating an existing one. Despite replacing the featured image and updating the Yoast SEO title and description, social link previews (for platforms like Facebook and LinkedIn) continued showing the old program title and image.

Common troubleshooting steps, including clearing page cache, purging CDN, and refreshing the Yoast metadata, didn’t resolve the issue.

When sharing the new page URL in messaging apps or social media, the preview still displayed the previous program name and outdated thumbnail image.

Diagnosis

Upon inspection, Freshy developers discovered that the issue stemmed from hardcoded Open Graph (OG) metadata left behind in the page’s underlying HTML.

Key findings included:

  • The <meta property="og:title"> and <meta property="og:description"> tags were hardcoded directly into the page’s header template.
  • These values were not dynamically linked to the Yoast SEO plugin, meaning Yoast’s changes to the title and image were being overridden.
  • Because the page had been duplicated, the old OG tags were copied as-is, preserving the outdated title and image path.

This prevented social networks from fetching the updated data, even after clearing caches and refreshing previews via tools like Facebook Sharing Debugger.

Resolution steps

  1. Locate the hardcoded OG tags – Developers used the “View Source” tool in the browser and confirmed that the outdated metadata was present:
<meta property="og:title" content="Medical Administrative Assistant">
<meta property="og:description" content="Learn the skills to start your career in medical administration.">
<meta property="og:image" content="https://example.com/wp-content/uploads/old-image.jpg">
  1. Remove hardcoded entries from the page template – The developer edited the page’s PHP template and removed these lines to allow the Yoast SEO plugin to inject its dynamic Open Graph data automatically.
  2. Regenerate metadata and clear cache
    • The Yoast SEO “social” tab was updated with the correct image and description.
    • The page cache was purged from both the WordPress caching plugin and the host-level cache.
    • The CDN was cleared to ensure propagation of the corrected meta tags.
  3. Validate metadata updates – Developers used the Facebook Sharing Debugger and LinkedIn Post Inspector tools to verify that the new Open Graph data was being read correctly.
  4. Final verification – The social preview now correctly displayed:
    • The new page title (“ImagingWorks”)
    • The updated description
    • The correct preview image

Final outcome

Once the hardcoded OG tags were removed and Yoast’s dynamic metadata was reinstated, the social preview issue was fully resolved.

When the page link was shared on social media, it correctly reflected the updated title and image. The client confirmed that the fix worked perfectly and restored confidence in their campaign marketing materials.

Key takeaways

  • Avoid hardcoding metadata, especially Open Graph and Twitter Card tags, into theme templates.
  • Rely on SEO plugins like Yoast or Rank Math for dynamically managed meta content.
  • Use the Facebook Debugger and LinkedIn Inspector to verify metadata updates after changes.
  • Always purge cache layers (WordPress, CDN, and browser) after metadata edits.
  • Check for legacy content after duplicating pages to ensure old template data isn’t copied over.

Having trouble with outdated social previews or meta data not updating on your WordPress site?
Contact Freshy for expert WordPress and SEO troubleshooting.