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