Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Developer · Guide

How to Find WordPress Admin URL From Database (Step by Step)

How to Find WordPress Admin URL From Database (Step by Step)

Short answer

Open your database in phpMyAdmin, go to the options table and read the siteurl value. Add /wp-admin/ to the end to get the admin address. If a security plugin hides the login page, search the same table for its custom slug, such as the whl_page option.

Key takeaways

  • The admin URL is the siteurl value plus /wp-admin/.
  • siteurl and home live in the options table.
  • WP_SITEURL in wp-config.php overrides the database.
  • Login-hiding plugins save their custom slug in the options table.
  • WP-CLI can read the value with one command.

How do you find the WordPress admin URL from the database?

Open the database, look at the options table, and read the siteurl value; your admin URL is that address followed by /wp-admin/.

WordPress does not store a separate admin URL. It builds the admin address from the siteurl option, which you can read in phpMyAdmin or with a simple SQL query.

So if siteurl is https://example.com, the dashboard lives at https://example.com/wp-admin/ and the login page at https://example.com/wp-login.php.

The only exception is when a security plugin has changed the login address. That custom slug is also saved in the database, and this guide shows where to look.

For background on the default addresses, see what the WordPress admin URL is.

Why would you need the database to find the admin URL?

You usually check the database when the site is installed in a subfolder, the domain changed, or a plugin hid the login page and nobody remembers the new address.

Common situations include:

  • You inherited a site and the old developer installed WordPress in a folder such as /wp/ or /blog/.
  • A login-hiding plugin redirects /wp-admin/ to a 404 page.
  • The site was migrated and you are unsure which domain it now expects.
  • You only have hosting access, not a WordPress login.

In each case, the options table holds the facts. Reading it does not change anything on the site.

It is also faster than guessing. Trying random folders like /admin/ or /login/ wastes time and can trigger security lockouts on hosts that block repeated failed requests.

The database gives a definite answer in under a minute once you know where to look.

What do you need before you start?

You need access to the site's database through phpMyAdmin, Adminer, a database client, or WP-CLI, plus the table prefix from wp-config.php.

Most hosts include phpMyAdmin in cPanel or their own dashboard. The phpMyAdmin documentation explains the interface if you have not used it.

If you do not know which database belongs to the site, open wp-config.php and read the DB_NAME line. Our guide on how to find the WordPress database name walks through it.

In the same file, find the $table_prefix line. The default is wp_, but many installs use a random prefix such as wp8k2_.

How do you find siteurl in phpMyAdmin?

Select your database, open the options table, and look at the first rows, where siteurl and home are usually stored.

  1. Log in to phpMyAdmin from your hosting panel.
  2. Click your WordPress database in the left sidebar.
  3. Open the table ending in _options, such as wp_options.
  4. Look for the rows where option_name is siteurl and home. They are usually near the top.
  5. Read the option_value column.

If the rows are not on the first page, use the Search tab and search the option_name column for siteurl.

Do not edit anything unless you mean to. Changing these values changes where WordPress thinks it lives.

If phpMyAdmin shows a long list of tables from several sites, match the prefix from wp-config.php. Shared databases can hold more than one WordPress install, each with its own options table.

If you see two options tables with similar names, the prefix decides which one belongs to the site you are fixing.

What SQL query shows the admin URL?

Run a SELECT query on the options table for the siteurl and home rows, replacing the wp_ prefix with your own if it differs.

Open the SQL tab in phpMyAdmin and run:

SELECT option_name, option_value
FROM wp_options
WHERE option_name IN ('siteurl', 'home');

The result shows two rows. Add /wp-admin/ to the siteurl value to get the dashboard address.

The MySQL manual covers the SELECT statement if you want to adjust the query. For more query examples, see how to query the WordPress database.

What is the difference between siteurl and home?

siteurl is where the WordPress core files live, so it decides the admin address, while home is the public address visitors type to reach the site.

They are often the same. They differ when WordPress files sit in a subfolder but the site is shown at the domain root.

OptionWhat it controlsExampleUsed for admin URL
siteurlLocation of WordPress core fileshttps://example.com/wpYes, add /wp-admin/
homePublic front-end addresshttps://example.comNo

In that example, the admin is at https://example.com/wp/wp-admin/, not at the root.

WordPress builds admin links with the admin_url() function, which starts from the siteurl value.

Can wp-config.php override the database value?

Yes, if wp-config.php defines WP_SITEURL or WP_HOME, those constants win over the database values, so check the file before trusting the options table.

Look for lines like these in wp-config.php:

define( 'WP_SITEURL', 'https://example.com/wp' );
define( 'WP_HOME', 'https://example.com' );

When these exist, the admin URL is the WP_SITEURL value plus /wp-admin/.

The wp-config.php documentation lists these constants and how they behave.

How do you find a custom login URL set by a plugin?

Search the options table for the plugin's setting; for example, WPS Hide Login stores its custom slug in an option named whl_page.

Login-hiding plugins replace wp-login.php with a custom slug. The slug is saved in the options table.

For WPS Hide Login, run:

SELECT option_value FROM wp_options WHERE option_name = 'whl_page';

If the result is secret-door, your login page is https://example.com/secret-door.

Other security plugins store the slug differently, often inside a larger serialized settings row. If you do not know which plugin is active, search option_name with a wildcard:

SELECT option_name FROM wp_options
WHERE option_name LIKE '%login%' OR option_name LIKE '%hide%';

Then open the matching row and look for a readable slug in the value.

Serialized values look messy, with letters and numbers such as s:12 before each string. Ignore those markers and read the text in quotes. The slug is usually a short word or phrase without slashes.

Avoid editing serialized rows by hand. A wrong character count breaks the whole setting, and the plugin may reset to defaults.

If you still cannot find it, rename the plugin's folder by FTP to deactivate it. The normal /wp-login.php address then works again. Our guide on deactivating plugins without admin access explains how.

How do you find the admin URL with WP-CLI?

Run wp option get siteurl from the site's folder over SSH; the command prints the value without opening phpMyAdmin.

wp option get siteurl
wp option get home
wp option get whl_page

The last command only returns a value if WPS Hide Login is in use.

The official wp option get reference lists the extra flags.

How does this work on WordPress multisite?

On multisite, each subsite has its own options table, such as wp_2_options, and the network admin lives under the main site's siteurl at /wp-admin/network/.

To find a subsite's address, look in the wp_blogs table. Each row lists a domain and path for one site.

The main site keeps the plain options table without a number. Its siteurl is the base for the network admin, and super admins can reach every subsite from there.

Then read siteurl in that site's numbered options table to get its own dashboard address.

What if the siteurl value looks wrong?

If siteurl points to an old domain or http instead of https, the admin may redirect to the wrong place, so fix it carefully or define the correct value in wp-config.php.

Back up the database before any edit. See how to back up a WordPress database.

Then either edit the option_value in phpMyAdmin or add WP_SITEURL and WP_HOME to wp-config.php.

If pages break after the change, read WordPress not working after changing site URL.

What is the quickest checklist?

Check wp-config.php for constants, read siteurl in the options table, add /wp-admin/, and check for a custom login slug if that address redirects or shows a 404.

  1. Open wp-config.php and note $table_prefix, WP_SITEURL and WP_HOME.
  2. If no constants exist, read siteurl from the options table.
  3. Visit siteurl plus /wp-admin/.
  4. If that fails, search the options table for a login-hiding plugin's slug.
  5. As a last resort, deactivate the plugin by renaming its folder.

Frequently asked questions

Which table stores the WordPress admin URL?

No table stores it directly. WordPress builds it from the siteurl row in the options table, usually named wp_options, by adding /wp-admin/ to the end. The table prefix can differ on your site.

Why does /wp-admin/ show a 404 page?

A security plugin may have hidden the default login address, or WordPress may be installed in a subfolder. Check siteurl in the options table and look for a custom login slug option from the plugin.

Is it safe to look at the database?

Reading rows is safe and changes nothing. Editing values is where risk comes in. Take a database backup before you change siteurl, home or any plugin setting.

What is the default WordPress login URL?

By default you can log in at your siteurl followed by wp-login.php. Visiting /wp-admin/ while logged out also redirects to that login page unless a plugin changed it.

How do I find the table prefix?

Open wp-config.php and look for the table_prefix line. The value, such as wp_ or a random string, appears at the start of every WordPress table name in the database.

Sources

  1. admin_url() WordPress Developer Resources
  2. wp-config.php WordPress Developer Resources
  3. wp option get WordPress Developer Resources
  4. WPS Hide Login WordPress.org Plugins
  5. phpMyAdmin documentation phpMyAdmin
  6. SELECT Statement MySQL Reference Manual

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.