Summary:
While migrating news posts from a legacy site to a WordPress development environment, the Freshy team encountered issues including repeated featured images and incorrect handling of external link fields. By reworking the import process and adjusting custom field logic, the team restored proper functionality.
Issue background
The project involved importing a large archive of news posts to a new WordPress development site. Initial imports appeared successful but introduced two main issues:
- Many posts were assigned the same featured image.
- A custom field for “external link” sometimes caused a validation error if the URL was not properly formatted with
https://.
These problems affected both the visual consistency and functionality of the imported content.
Diagnosis
Freshy’s developers audited the import logic and content structure:
- Featured image duplication was traced back to a scraping script that failed to pull distinct images when pages had similar image metadata.
- The “external link” field was a URL-type field that validated input but broke on plain text or incomplete entries.
Resolution steps
- Scraper update: The team revised the import script to re-fetch individual featured images from each article page, ensuring unique assignments.
- Image optimization: Some extremely large images were manually downloaded, resized, and compressed to prevent performance issues.
- Field type adjustment: The problematic URL field was converted to a regular text field in the post type’s settings. This bypassed the need for strict URL validation.
- Conditional logic for display: Developers noted that if a post had an external link, it was treated as an offsite reference. Otherwise, the post would render as standard site content.
Final outcome
All news posts were successfully re-imported with unique featured images and the “external link” field behaving as expected. The site now correctly distinguishes between regular and outbound posts, supporting a seamless content experience.
Need help with WordPress content migrations or custom post type logic? Contact Freshy — we specialize in tailored solutions for complex CMS workflows.