Importing XML to Wordpress, permalink changing form the original

226 views Asked by At

I just don´t know what I am doing wrong.

I have the latest xampp, also wordpress 4.5.2, and I make an XML file, with all the posts that I need to import, but when I import it the permalink is cutoff the middle part.

In the XML file there is the tag link, which define the permalink from each post, and is structure like the exemple bellow

http://localhost/site/man-clothes/jeans-pants/ripped/rock-style

http://localhost/site/man-clothes/jeans-shorts/washedout/rock-style

But when I import the XML file, the permalink gets cutoff like so:

http://localhost/site/man-clothesrock-style

http://localhost/site/man-clothesrock-style

Does anyone knows why wordpress cutoff the middle part? I think it was the .htacess file, but I remove and still does this change in the permalink.

1

There are 1 answers

0
Alê Moraes On BEST ANSWER

I figure out was I was doing wrong.

There´s a tag named "post_name" in the xml. And there´s a tag named "link"

So I have to set this two fields, with the adress that I need.

So in the "link" fild is setup this way:

<link>http://localhost/site/man-clothes/jeans-pants/ripped/rock-style</link>

And the "post_name" fild I setup like this:

<post_name>man-clothes/jeans-pants/ripped/rock-style</post_name>

Now the permalink show like this

http://localhost/site/man-clothesjeans-pantsrippedrock-style

He takes the whole string, but, trim off the "/" from it.

If some one knows why this happens, I'll appreciate the help.