How to Get a List of WordPress PDF, Image, Post, or Page URLS

  • Updated on
  • read
  • Add to Flipboard Magazine.

Below are two PHP scripts you can use to help get a list of URLs of content in your WordPress site. I use these when I am migrating posts or media library files to another sites without using a plugin.

Follow the steps below to use these scripts

  1. Open a text editor and copy and paste one of the code blocks and save the file as get-urls.php
  2. Upload the get-urls.php file to the root directory of your wordpress install not your themes folder
  3. In your browser go to yourdomain.com/get-urls.php

Get List of Attachments

Once you have your list of URLS you can use this handy chrome extension to download them into a folder.

 

Get List of Pages

Regex Find and Replace Old domain with New One

 

Written by: Jacob Lett - Jacob started BootstrapCreative to help others learn web design and development. He has built websites for 10+ years for companies and as a freelancer. He enjoys learning and encouraging others to improve their skills.
Category: Code Snippets
Tags: ,

Want to Get Email Updates?

Receive a monthly digest of new tutorials and resources.