Have a technical problem or question, call on the Computer Plumbers!

Are you frustrated and feel like flushing your computer? No matter what the situation, the Computer Plumber can help!!

Shell script to get all WordPress databases and URL’s

Below you will find a simple script that you can use to find all the databases and URL’s associated to wordpress sites in a shared database. This script requires a SQL user with the ability to ‘show databases’ and access to the DB’s you want to query.

The script grabs a list of all the databases on the server then loops through them all retrieving the URL from the wp_options table. The script also takes into consideration the fact the the table might not actually be wp_options (could contain some random characters) so we use a wildcard there.