Search code examples
xmlwordpressediting

editing XML file before importing into Wordpress


I want to export each page on my Wordpress individually to keep as a backup and move others to another Wordpress site.

I installed Wordpress Exporter which allows me to easily export one page at a time.

The only issue is that when I import the pages I am keeping into the new one, it also imports different users that is not a part of the page itself.... it's just users in general.

My question is, can I delete the user code and import it without it affecting anything or do I have to leave it in there and delete the users each time?

i.e.

<wp:author><wp:author_id>2</wp:author_id><wp:author_login>USER NAME 1</wp:author_login><wp:author_email>EMAIL HERE</wp:author_email><wp:author_display_name><![CDATA[NAME]]></wp:author_display_name><wp:author_first_name><![CDATA[FIRST NAME]]></wp:author_first_name><wp:author_last_name><![CDATA[LAST NAME]]></wp:author_last_name></wp:author>


	<wp:author><wp:author_id>1</wp:author_id><wp:author_login>USER NAME 2</wp:author_login><wp:author_email>EMAIL HERE</wp:author_email><wp:author_display_name><![CDATA[NAME]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>
	
  	<wp:author><wp:author_id>1</wp:author_id><wp:author_login>USER NAME 3</wp:author_login><wp:author_email>EMAIL HERE</wp:author_email><wp:author_display_name><![CDATA[NAME]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>
	
  	<wp:author><wp:author_id>1</wp:author_id><wp:author_login>USER NAME 4</wp:author_login><wp:author_email>EMAIL HERE</wp:author_email><wp:author_display_name><![CDATA[NAME]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>
	

I figure I can delete the whole code for the new user:

  	<wp:author><wp:author_id>1</wp:author_id><wp:author_login>USER NAME 4</wp:author_login><wp:author_email>EMAIL HERE</wp:author_email><wp:author_display_name><![CDATA[NAME]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>

Leaving only the MAIN user.... if I did that, would anything happen if I upload the file? The page was created by me so I just want to leave my user information to be uploaded. The other users were just added randomly.


Solution

  • When we import into WordPress using XML, we have two options i.e. create users as per the old site, or assign all posts to new users on the current site.

    So you can safely delete or even no need to delete, just during the IMPORT process, select assign posts to current user in the Website, and it will not need to import or create those all other users.