How to Export WordPress URLs (Using Two Different Methods)

Last Updated on January 20, 2023 by 35 Comments

Editorial Note: We may earn a commission when you visit links on our website.
How to Export WordPress URLs (Using Two Different Methods)
Blog / Tips & Tricks / How to Export WordPress URLs (Using Two Different Methods)

Migrating your WordPress site to a new host, or setting up redirects, are common practices for those who run into problems with their hosting provider or site structure. They’re just two of many scenarios in which you would need to export WordPress URLs.

Fortunately, there are a number of free plugins and tools to help you get the job done. In this post, we’ll explain why you’d need to export your WordPress URLs, then show you how to do it using two different methods. By the time we’re done, you’ll be able to export WordPress URLs with aplomb!

What WordPress URLs Are and Why You Would Need to Export Them

For the uninitiated, WordPress URLs (also called ‘permalinks’) are the unique links to your content, and setting them up correctly has a number of Search Engine Optimization (SEO) benefits. What’s more, WordPress is more than just a powerful Content Management System (CMS). It also comes bundled with a handy toolkit of its own that enables you to undertake maintenance-related tasks without having to get into a single line of code – including exporting your WordPress URLs.

So, why would you need to export your site’s URLs? There are a number of scenarios where you’ll find you’ll need a complete list. For example:

  1. Migrating your WordPress site: If you’d like to migrate your WordPress website without affecting your SEO, you’ll have to update the URLs ahead of time.
  2. Moving your site from a localhost installation to a live installation: When it’s time to launch your site, you may need to modify your URLs to reflect your live domain.
  3. Setting up redirects: If you’d like the traffic from one page to be sent to another, you’ll need to redirect your WordPress URLs to the new link.
  4. Sharing URLs with your SEO team: It’s a common practice, and you may need to update your URL structure as a result. It’s a similar case with setting up tracking with SEO tools.

With that brief overview out of the way, let’s dive right into the tutorial! We’ll start out by walking you through the process of exporting WordPress URLs using a plugin (the easy way), then show you how you can do the same manually (the hard way).

How to Export WordPress URLs Using a Plugin

It’s always a good idea to make a backup of your website before tinkering with your site’s core files (that’s easy using a WordPress backup plugin). That way, if the worst happens, you can almost instantly roll back to a clean, working version of your site.

Plugin to export WordPress URLs

Install the Export All URLs plugin to get started.

Once you’re fully backed up, you’ll want to install a suitable plugin – we’re using Export All URLs. This plugin offers a quick and easy solution to extract the URLs, titles, and categories of your posts and pages. For our purposes, we’re only interested in exporting WordPress URLs.

Exporting to CSV

The Comma Separated Values (CSV) format is generally used to store tabular information. This data is usually exported to a spreadsheet file (such as Microsoft Excel) with one record per line.

CSV files should be used when you already understand the structure of your data. In this case, we know that we’re only exporting WordPress URLs, which makes exporting to CSV a good choice. Here are some additional benefits:

  1. CSV is readable by humans.
  2. The format is easy to edit and modify manually.
  3. Almost all existing applications support the CSV file format.

How to Export Your URLs in CSV Format

Firstly, log in to your WordPress site’s admin panel, then navigate to Settings > Export All URLs. At the next screen, select the following options:

  • Select a Post Type to Extract Data: All Types (pages, posts, and custom post types).
  • Additional Data: URLs.
  • Export Type: CSV.

Finally, click the Export button to export the URLs in CSV format:

The Export Data… screen.

Once exported, a notification will be displayed with a link to download the data. Once you download the file, it’ll display a list of your site’s URLs.

Exporting to Plain Text

Plain text is simply a format that doesn’t have any tags or special formatting in place – it’s data that isn’t written in code under the hood.

The obvious benefit of exporting to plain text is that it’s incredibly easy to read by humans, especially when offered in an HTML or XML file. Aside from this, there are a few other reasons you may want to export to plain text:

  1. Plain text doesn’t require specific software to edit its contents.
  2. It’s robust in the face of data corruption.
  3. It enables different programs to access each other’s files.

How to Export Your URLs in Plain Text Format

Similarly to exporting to CSV, log into your WordPress site’s admin panel, then navigate to Settings > Export All URLs. At the next screen, select the following options:

  • Select a Post Type to Extract Data: All Types (pages, posts, and custom post types).
  • Additional Data: URLs.
  • Export Type: Output here.

Finally, click the Export button to export the URLs:

Plain text file format.

Once exported, the URLs will be displayed below your settings, where you can copy and paste them into your favorite text editor.

How to Export WordPress URLs Manually

Although using a plugin produces good results, you may want to export your URLs manually – at the very least, you’re saving potentially valuable resources. For this method, you’ll need access to a File Transfer Protocol (FTP) client – we recommend the open-source FileZilla – or use the File Manager in cPanel. If you’re new to FTP, find a good tutorial, and brush up on your skills before starting – and don’t forget to create a backup of your WordPress website before you begin!

To get started, create a new file on your computer, and enter the following code (based on a Bloggersignal snippet) encased within PHP tags:

include "wp-load.php";
$posts = new WP_Query('post_type=any&posts_per_page=-1&post_status=publish');
$posts = $posts->posts;
header('Content-type:text/plain');
foreach($posts as $post) {
    switch ($post->post_type) {
        case 'revision':
        case 'nav_menu_item':
            break;
        case 'page':
            $permalink = get_page_link($post->ID);
            break;
        case 'post':
            $permalink = get_permalink($post->ID);
            break;
        case 'attachment':
            $permalink = get_attachment_link($post->ID);
            break;
        default:
            $permalink = get_post_permalink($post->ID);
            break;
    }
    echo "\n{$permalink}";
}

Next, save the file as a .php file and name it exported-urls.php. Once saved, log into your FTP client using the credentials provided by your host, navigate to your root directory (normally called www or public_html), then upload the exported-urls.php file.

Once complete, navigate to http://www.yoursite.com/exported-urls.php in your browser, where you’ll see a list of your exported URLs. From there, you can copy the links as normal.

Conclusion

Exporting your WordPress URLs is a common task, especially for migrating your site or setting up redirects – but for some it could be difficult. There’s a method available for any level of technical expertise, and in this post, we’ve walked you through two different ways to achieve it:

  1. With a plugin: The Export All URLs plugin is probably the best option for the majority of WordPress users.
  2. Manually: Exporting URLs manually with an FTP client or the File Manager in cPanel is ideal for those who are comfortable with code.

After reading this piece, you should now be in a good position to export your own WordPress URLs.

Do you have any questions about how to export your WordPress URLs? Subscribe to the conversation, and let us know in the comments section below!

Article thumbnail image by harper kt / shutterstock.com.

Divi

Want To Build Better WordPress Websites? Start Here! 👇

Take the first step towards a better website.

Get Started
Divi
Premade Layouts

Check Out These Related Posts

Splice Video Editor: An Overview and Review

Splice Video Editor: An Overview and Review

Updated on March 10, 2023 in Tips & Tricks

Video is a valuable form of content for social media. Unfortunately, creating quality videos is usually a long process that involves moving mobile footage to a desktop app for editing. However, mobile editing is on the rise. Apps such as Splice Video Editor make it possible to efficiently create...

View Full Post
How to Use Font Awesome On Your WordPress Website

How to Use Font Awesome On Your WordPress Website

Updated on September 16, 2022 in Tips & Tricks

When given the choice between using a vector icon or a static image, it’s a good idea to go with the vector. They’re small and fast to load, and they can scale to any size without a loss of resolution. Font Awesome is a superb library of vector icons that you can use on your websites,...

View Full Post

35 Comments

  1. This worked perfectly with php method. The plugin gave me errors. Is there a modification I could make to php that would also echo a column to identify if it is a post or a page?

  2. Thanks for the info. Always love coming to the blog ?

  3. It can help other people who wants to know how to Export WordPress! KEEP UP the GOOD work! 🙂

  4. Thank you! It gave me knowledge. Hoping to see your next post!

  5. It gave me knowledge! Wishing to see one of your posts again!

  6. It was a nice knowing this Export URLS!

    • Thanks for the kind words, Nico!

  7. I was succesful on “Export All URLs” plugin method. Thank you very much for sharing that.

    • No problem, Rayhan!

  8. You can also use screaming frog

    • Thanks for the tip, Bulut. 🙂

  9. Thanks ?

    • No problem, Ylem. 🙂

  10. Great article. I have a question…I am using http for now at my web page. Should I condiser moving to https or is it to sson?

    • Switching to HTTPS is never too soon. Do some research, though – you could introduce further problems if you’re not careful.

      Thanks for your question. 🙂

  11. The plugin allows you to export URLs, title, categories. There is also an option to either export this data in a CSV file or display it right on the settings page.

    Steve

  12. Nice. Didn’t know it would be this easy to aggregate all urls and export 🙂

    • Well, now you do James. 🙂

  13. Hi everyone

    How can I insert urls, from HTML web pages into WordPress. Or from other web systems. Or rather, no Wordoress convert websites into a WordPress page.

  14. I’m missing something (big): now that one knows how to export the URL’s can you please tell us how to actually USE the exported URL’s in support of each of the scenarios you mention?

    • That, Jon, is a subject for another article! It was slightly outside of the remit for this one, but we’ll look to write up something about importing another time.

      Thanks for your comment. 🙂

    • Sorry I’m with Jon here – what next? For every export there is a corresponding import?

    • Yes, I also would like to know how to USE the exported URLs in the four scenarios mentioned.

    • Yes, I also don’t understand what you need the list of URLs for, or how to use them. Thanks.

  15. Thank you 🙂
    You have done a very nice expression, probably worth a try 🙂

  16. You can also use screaming frog 🙂

    • Thanks for the suggestion, John-Pierre. 🙂

  17. Migrating a website from one platform to another is a little tough job and when we migrate our blog/website from wordpress to other CMS we had to export our WP URLs. Here you have described the full method very easily and effectively which will help newbie bloggers to migrate their blogs. Really great guide. Thanks for sharing the information added beautiful guide here.

  18. Hi Jhon,

    I have a site created with Divi, but expired the domain name that I used for this site.

    Then, I bought a new domain name,

    I want to know:

    How to can I use the files the this site with the new domain name?

    do you have any recomendations for me?

    thanks in advance!

  19. LOVE this php file! Great for redirect logs. Thanks.

  20. I get urls from sitemap.xml 😉

    • Thanks for the additional tip, Javier. 🙂

Leave A Reply

Comments are reviewed and must adhere to our comments policy.

Get Started With Divi