1

I've tried many times to upload theme-unit-test-data.xml from http://codex.wordpress.org/Theme_Unit_Test But when I'm trying to upload this file in WordPress Importer it gives me an error saying:

Sorry, there has been an error. This does not appear to be a WXR file, missing/invalid WXR version number

I'm using the latest version (4.0) of the WordPress CMS.

Edit: I reinstalled the WordPress importer plugin and downloaded the Theme Unit test XML file multiple times with the same result.

0

2 Answers 2

0

It seems your XML file not valid. Try to import another xml and check. If another xml imports then its 100% issue with your XML in which you are getting error.

6
  • I've tried several others, it didn't help much. Commented Nov 20, 2014 at 13:39
  • Did you specified WXR version in your file? Like :<wp:wxr_version>1.1</wp:wxr_version> Commented Nov 21, 2014 at 5:07
  • Yes, it was specified in the origital file: <wp:wxr_version>1.2</wp:wxr_version> Commented Nov 21, 2014 at 8:34
  • change permission of your wp-content to 755. Then try. This is last try I think. Commented Nov 21, 2014 at 8:58
  • Also try by changing browser , clear cache of your wordpress site using cache plugin.then try to import. Commented Nov 21, 2014 at 9:07
1

I had the same problem. It turned out that there were some ASCII - control characters in the file (export.xml) which are not accepted by the importer. Some of those characters are only visible in a hex-editor.

I removed those characters with the following terminal command:

tr -d '\000-\010\013\014\016-\037\177' < export.xml > new-export.xml

The tr command shown above removes all control characters except Horizontal Tab, Line Feed and Carriage Return from the file and saves a clean file. The new-export.xml then was successfully accepted by the importer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.