
Summary
Key points of this document
- Where are the design challenges?
- How to define boundaries
- Details that matter in implementation
Overview
When publishing business system information to a website, manual copying can lead to missed updates or inconsistencies in notation. If you use the WordPress REST API, you need to design the unit of synchronization and how to handle failures. While WordPress REST API integration may seem like a process of creating posts, it is actually a pipeline that synchronizes the publication status between an external system and a CMS.
Where are the design challenges?
Directly reflecting data from the business system into WordPress can expose internal items or make the management of publication status ambiguous. Problems also arise when API integration fails, making it unclear how much has been reflected.
While WordPress is strong in public display, it may not be the authoritative source for business systems. It is necessary to decide which system is the source of truth, whether to allow manual editing, and whether to include a pre-publication review.
When flowing information from an external system to WordPress, not only the article body but also categories, tags, featured images, publication date, updater, and handling upon deletion become issues. Even if an API call succeeds, the state on the CMS may not be as expected.
How to define boundaries
Create a DTO for publication on the business system side and send only items that are safe to publish to WordPress. Synchronization is not a full overwrite but treated as creation, update, and unpublishing using an external ID. In case of failure, re-execute from the synchronization log.
In design, do not directly push external data to WordPress; separate synchronization targets, conversion results, and transmission results. Map the external record ID to the WordPress post_id to prevent duplicate posts even if the same data is resent.
Details that matter in implementation
For API integration, save post ID, external ID, last synchronization time, synchronization status, and error details. Map WordPress's draft, published, and unpublished states to business-side states, and template content generation to make diff reviews easier.
On the Laravel or batch side, publishjobs, publishtargets, publishattempts, and use payloadhash to check for differences. Separate media registration and post association for featured images into different steps, clarifying where to resume in case of partial failure.
- Save not only the WordPress post_id but also the external ID and synchronization version.
- Treat pre-publication preview, draft updates, and actual publication as different job types.
- When an API fails, record the response body, HTTP status, and target ID to enable reprocessing.
Observing failure modes
In verification, confirm cases such as API authentication failure, update failure after post creation, conflicts with manual edits, and unpublishing instead of deleting. Log the destination URL and ID, and ensure that resending the same data does not result in duplicate posts.
In verification, confirm initial posting, updates, image replacement, category changes, deletion, and scheduled posts. Include tests for items that should be overwritten and items that should be retained in the next synchronization if manually edited on the WordPress side.
Discarded options and tradeoffs
Strict API synchronization is incompatible with operations that allow free manual editing. If publication quality is prioritized, there is also the decision to allow final editing on the WordPress side and limit the scope of automatic updates for business data.
Making WordPress the sole editing location simplifies operations but makes it difficult to maintain consistency with external systems. Full synchronization from external sources increases consistency but restricts manual editing on the CMS. It is necessary to decide which one is the source of truth first.
Decision criteria to leave on site
For WordPress integration, the scope of synchronization responsibility is more important than the ability to post. By separating data for publication and assuming diffs and re-execution, a safer publication flow than manual work can be created.
In designing WordPress REST API integration, being able to explain the synchronization status is more important than being able to post. Simply having an external ID and history greatly improves ease of re-execution and recovery.


