How to migrate auto blog content IDs and relationships without breaking cross-post references: Migrate the content IDs first, then remap every…
Last updated: December 01, 2026
Migrate the content IDs first, then remap every post-to-post reference against a source-to-destination map. If the IDs in your auto blog are not preserved, related posts, custom references, and internal links that point by ID will break unless you rebuild those links from an ID translation table.
Key takeaways
- Post IDs in WordPress are local to each database, so a copied post almost never keeps the same number.
- The safest move is a 2-column mapping: old ID on one side, new ID on the other.
- Related posts, custom references, and internal links fail in different ways, so each one needs its own check.
- A raw export/import is not enough if the plugin stores IDs inside post meta or custom fields.
- If your source plugin stores relationships only in rendered HTML, you need a content rewrite step, not just an import.
What changes when WordPress IDs move?
WordPress post IDs change when content moves to a new site, because the destination database assigns its own numbers. That is the core reason cross-post references break, even when the post title, slug, and content all import correctly. A related-post link that pointed to ID 184 on the old site may point to a different post, or to nothing, on the new one.
The break usually shows up in 3 places. First, related posts widgets or blocks that store target IDs in post meta. Second, custom references inside fields such as “related_article_id,” “source_post_id,” or another plugin-specific key. Third, internal links inside the content body if the plugin wrote them as numeric query strings or custom shortcodes.
This is also where a lot of migration advice goes wrong. A normal WordPress export/import can move posts, pages, and media references, but it does not promise to preserve numeric IDs across two databases. If your auto blog depends on those numbers, the import is only half the job.
This page is for the move where the relationship itself matters as much as the post content. It is not the right guide if your bigger problem is updating old URLs, fixing broken slugs, or comparing source and destination content after the move; those are separate tasks.
Which IDs and relationships need a map?
You need a map for every field that points from one post to another by number, not by slug. In practice, that means at least the 4 common places where auto blog setups store relationships: post meta, custom fields, shortcode attributes, block attributes, and sometimes plugin tables outside wp_posts.
The safest way to think about it is simple: if the source system stored “post 27 links to post 41,” then the destination system needs to know what became of both 27 and 41. Without that lookup, the relationship becomes guesswork.
A useful map has 2 columns and one row per imported post: source ID and destination ID. If you also have parent-child structures, add a third field for the old parent ID so you can rebuild hierarchy after import. That matters for things like nested pages, series posts, or module trees.
Here is the practical rule: do not try to rebuild relationships by title alone unless the title is the only stable key you have. Titles can change during import, and two posts can share the same title. Slugs help more than titles, but they still are not a full substitute for an ID map.
How do I migrate WordPress post IDs and relationships?
You migrate WordPress post IDs and relationships by importing the content, capturing the new IDs, then rewriting every reference from the source ID to the destination ID. The process is mechanical, but it has to be done in order.
-
Export the source content with the relationship data included.
Use the WordPress export screen or the plugin’s own export if it stores relationships outside normal post content. The result should include posts, custom fields, and any custom taxonomy terms that the relationships depend on. -
Import into the destination site and record the new IDs.
After import, each post gets a fresh WordPress ID from the destination database. Build a 2-column map that links the old ID to the new one as soon as the import finishes, before any cleanup or edits blur the trail. -
Find every field that stores a source ID.
Check post meta, custom fields, shortcode attributes, and any plugin tables that hold related-post IDs. If a field stores 3 IDs in a comma-separated string, treat each value as a separate reference. -
Rewrite the stored values using the map.
Replace each old ID with the matching new ID. If a source ID has no destination match, leave it out and log it for review rather than guessing. Guessing here creates silent breakage that is hard to spot later. -
Refresh the rendered content and caches.
If related links are output through a widget, block, or cached module, clear the cache after the rewrite. Cached HTML can keep old numbers alive even after the database is fixed. -
Check parent-child and cross-post links separately.
Parent IDs and sibling references are not the same thing. A post can import with the right title and still lose its parent, its related-post set, or its “next in series” link if those are stored in different fields. -
Run a spot check on the most connected posts.
Start with posts that have the most outgoing references, because they expose map errors fastest. One missed ID in a hub post can hide 10 broken links under it.
For WordPress-native tools, the WordPress documentation for export/import is the right starting point, and WP-CLI’s search-replace command is useful when you are rewriting stored values in bulk. The official pages are the place to confirm command syntax before you touch live data: WordPress export/import documentation and the WP-CLI search-replace command page.
What breaks cross-post references the fastest?
Cross-post references break fastest when the relationship is stored in a place the export does not treat as first-class content. That usually means 3 problem zones: serialized metadata, plugin-specific tables, and hardcoded IDs inside markup.
Serialized data is the most fragile. A single numeric change inside a serialized array can corrupt the whole field if you edit it as plain text without respecting the data format. That is why a blind find-and-replace is risky when the field comes from a plugin that stores complex settings.
Plugin tables are another trap. Some auto blog tools keep relationship data outside the normal WordPress post and postmeta tables. If you import only posts and meta, the content may appear intact while the relationship table is empty.
Hardcoded IDs in content are easier to miss because they look like ordinary text. A shortcode such as [related_post id="41"] or a link with a numeric parameter can survive the import as plain text but still point to the wrong thing. The fix is not to hope the slug saves you; the fix is to rewrite the number itself.
The cost of skipping this step is simple: the post loads, but the linked content is wrong. That is worse than a visible error because it looks fine until a reader clicks it.
Which method should I use?
The right method depends on where the relationship lives and how much of it is stored in WordPress itself. A simple import is enough for content that uses slugs or normal internal links, but ID-based auto blog relationships need a remap.
| Method | Best for | Weak spot | Fit for ID-based references? |
|---|---|---|---|
| Standard WordPress export/import | Posts, pages, basic media migration | IDs change in the destination database | No, not by itself |
| Import plus manual ID map | Small to medium auto blogs with clear metadata | Time cost grows with more posts | Yes |
| Import plus bulk rewrite of stored fields | Large sets of post meta or custom references | Serialized data needs care | Yes |
| Plugin-specific migration tool | Relationship-heavy plugins that keep their own schema | Tool may not cover every field | Sometimes |

If the site uses only a few relationships, a manual map can be enough. If the site has many connected posts, or if the plugin stores references in several places, the safer route is a bulk rewrite based on the old-to-new map. That is slower up front, but it reduces the chance that one broken ID leaks into dozens of posts.
This is not the job for a casual content edit. If you cannot identify where the IDs live, the migration is not ready yet.
What should I check before going live?
You should check the 5 places most likely to hide a broken reference before the site goes live. Start with the posts that have related-post modules, then move to parent-child pages, then inspect custom fields, shortcodes, and cached output.
Open a sample post and confirm that every linked item still resolves to the correct destination post. Then inspect the source of the rendered page or the block settings if the related content is generated by a module. A visible title is not enough; the target ID behind it has to be right.
Also check posts with multiple references in one field. If a field holds 3 IDs and one of them fails, the module may still render while silently dropping part of the set. That creates uneven related-post groups, which can be harder to spot than a complete failure.
The last check is the one people skip most often: look for orphaned IDs in the database or export log. An orphaned ID is a source ID with no destination match. If the migration left one behind, you want to know that before readers click it.
What this method is not for
This method is not for a move where you only need to fix URLs after changing domains, and it is not for a full database migration where every table is copied as-is. It is specifically for preserving post ID relationships when the destination site assigns new IDs.
It is also not ideal when the source plugin stores no clean relationship field at all. If the only place the connection exists is in generated HTML, then the job becomes content parsing and rewrite work, which is slower and easier to get wrong. In that case, a relationship map alone will not save you.
The upside is clear, though. If you control the map and rewrite the references once, you protect the linked structure of the auto blog instead of just moving its text. That is the difference between a site that imports and a site that still behaves like the original.
For the wider migration sequence, the hub on WordPress auto blog migration content transfer can sit above this page, while this page handles the ID and relationship layer that most guides skip.
Do post IDs change after import?
Yes, post IDs usually change after import because the destination WordPress database assigns its own numbers. That is normal behavior, not a failure. If any related content points to the old numbers, those references need a rewrite against a source-to-destination map.
How do I keep related content connections intact?
Keep a mapping file from the start, then rewrite every stored reference after import. The safest pattern is old ID to new ID, with any missing matches logged instead of guessed. That protects related posts, custom references, and internal links from pointing at the wrong destination post.
Drafted with AI; not yet reviewed by a person.