Wordpress CLI ignore duplicates

103 Views Asked by At

I am using WordPress CLI to import pages from one site to another.

On the new site we rebuild 200 pages using ACF, these pages have the same slug as the original pages.

I have 700 pages to import in total.

is there anyway to ignore the rebuilt/duplicate pages by slug(or anything) when running the CLI command? I can't find anything in the docs here https://developer.wordpress.org/cli/commands/import/#examples . I was hoping someone else may have found a solution

wp import myoldsite.wordpress.2022-09-15.002.xml 
1

There are 1 best solutions below

0
On

This should work automatically, here is an example how the output looks like if you try to import existing posts/pages:

Processing post #39 ("Test") (post_type: page)
-- 111 of 113 (in file test.wordpress.2023-03-31.000.xml)
-- Fri, 31 Mar 2023 16:20:10 +0000
Page &#8220;Test&#8221; already exists.<br />-- Added post_meta _edit_last