Looking for a way to export a list of pretty permalinks in WordPress with the corresponding post title. Looking for the actual permalink structure defined not the shortlink. I suppose if I have to, I will use a short link, but I prefer the full permalink.
Leave a Reply
You must be logged in to post a comment.
Here’s a standalone PHP file you can save into the root of your website called something like
/export.php
and when you call it with your browser it will send a tab-delimited plain text list of posts with the pretty permalink, the post title and (as a bonus) the post type.Just load the URL in your browser and then “save as” to a text file you can then load in Excel or however else you need to process it.
Hope this helps.
-Mike
P.S. I used the standard WordPress
WP_Query()
but also included a commented-out SQL in case you prefer (or need) to use it instead.answered this one on EE this morning 🙂
http://wp.daveheavyindustries.com/2011/02/08/wordpress-permalink-via-sql/
this query should do it for you
I also wanted this solution and thanks @MikeSchinkle for the original solution. I did use this to export those links in plain text to excel and then build my redirect list.
But then I found that I also wanted a solution with live, active links.
So I used the
wp_query
using the post type “any” and created a page template with a search form included with the following query (customize to fit your theme as you see fit). Note I had to set theposts_per_page
at -1 to return unlimited results. This returns results as: “Title – Permalink”Hope that helps others.