I’m not the plugin author, but I believe the HTML_Import class in html-importer.php defines a method get_post that reads the file and creates the page. This class builds up a WordPress post object in the array $my_post, without explicitly specifying the slug, and then inserts the post into the database with the lines
if ($updatepost) {
$my_post['ID'] = $post_id;
wp_update_post( $my_post );
}
else // insert new post
$post_id = wp_insert_post($my_post);
I believe these functions wp_update_post and wp_insert_post generate the slug from the title when the slug is not specified. So if you know how to compute the slug you want to use, then setting the slug to $slug should be as easy as adding
$my_post['post_name'] = $slug;
before the post insertion code.
Exactly right, Mark. I’ve had several requests for this feature, and I’ll try to include it in a future version.
Thanks Stephanie.
Also, I’ll post another request in a different topic, considering an HTML often comes with a re-design and all the images will need a new width.
ok…this confused me. will this help keep my old and ugly file names to be the same as they used to be?
uglylongfilename.php vs /ugly-long-file-name/?
From an SEO perspective am I going to hurt my site by importing the pages and renaming them to the WP standard or am I not going lose good rankings by changing from ugly file name to the WP default?
SILLYbean any update on your statement….?
we are still waiting for the features to keep original SLUGs.
This feature will be in the next version of the plugin.
Now the question is…..
WHEN next version will be OUT….!
if its delayed i may finish my project HARD way.
anyway thank you for the update.
You can download the development version and give the new option (“preserve slugs”). It should show up as version 2.3a.
aha… its ready.
Thank you Stephanie….
i will do BETA testing…. and let you know.
i cannt see the option “preserve slugs“
where is this option ?
under Files/Content/Title/MEta/Category/Tools ?
No, it’s under the first tab, “Files.”
its not there.
i reinstalled after manually deleting from phpmyadmin
there are only 5 options
//Directory to import
old site URL
Default file
File extensions
directories to include
Its added in html-importer.php file but not in html-import-options.php.
may be you are missing something
Yes, the file for the options page didn’t get updated. Try downloading a fresh copy; it should be there now. Sorry about that!
THANK YOU Stephanie;
it worked. i imported 1615 pages in one shot.
but it rename main page slug as long Title page name.htm as well as sundirectory index page name as its Title page slug.
if you donot want to include TITLE, it will take page id number instead its original page slug.
if same slug exists in different directories it will add slug name and -1.htm (eg: slug-1.htm, slug-2.htm)
thats what i found out so far, i will update if anything more
THANK YOU VERY MUCH.
I’ve just released 2.3, which includes this feature.