I recently converted a site from Moveable Type to WordPress and noticed that the permalinks for each post are short, cut off and have underscores in them.
What I am looking to do is if there is a script or SQL command I can run to mass change each posts permalink to the default permalink it would have normally generated based on the post title.
Thanks in advance!
Maybe this doesn’t answer your question… but maybe you can adapt it to suit by changing what you put into $slug.
Try this, which should loop over posts and reset the slug to match the post name. For pages, add
'post_type' => 'page'
to the array passed to get_posts().It would seem the importer did not fully import slug names, or had a slug limit, which caused this effect.
You can run a query to update all the slugs based on article names, which is the default approach by WordPress as well when generating the initial slug (referenced as *post_name* in the DB table *wp_posts*).
It is recommended to first sanitize your post names of course (using sanitize_title_with_dashes() for this purpose seems apropriate.
A short snippet that performs an update to the slug of all posts was created for the purpose of this question and can be seen at https://github.com/Clorith/wp-slug-update if you don’t wish to start touching upon the code aspect your self.