In this blog post, I’ll share a quick and easy way to see option data in WordPress without needing to access the database via a database management tool.
This is useful if you are developing functionality that stores data in options and you want to quickly review what the current stored value is.
Table of Contents
What are WordPress options?
When you use the WordPress dashboard, there are a multitude of general settings you can configure, coming from WordPress itself, plugins, themes, etc. Generally, these settings are stored in a database table named wp_options
.
When developing custom functionality, or if you’re just being nosey, you can view this data via a database management tool, like phpMyAdmin.
However, if you just want to quickly see what options have been stored and their value, you don’t have to navigate off and through a database management tool to do so.
Accessing options via the dashboard
There is a hidden page in WordPress that lists all the options stored, you can access this by logging into your WordPress dashboard and then access this URL:
https://example.com/wp-admin/options.php
Replace https://example.com
with your domain name, also, if you have modified the wp-admin
directory name, you’ll need to replace that too.
Upon accessing this URL, you’ll see something like this:
The layout of this page is as follows:
- The left side shows the option name, which is the
option_name
from the database row - The right side shows the option value, which is the
option_value
from the database row
If you wish, you can modify the values and save the options via the save button at the bottom of the page, review the warning at the top of the page, and read the caveats below before doing so.
Caveats
Unless you have a good understanding of an option and its values, editing the values is not recommended.
- The values will correspond to code that makes aspects of your site function, some are simple, like yes/no, or on/off, but the value to be used is dependent on the code related to it, so don’t guess what the value may be that you want to use, investigate the correct value from the source of that option
- Some values you see may be stored as serialized data, which means there is a large amount of data stored against it, e.g. an array, and therefore these can’t be edited via this method and show
SERIALIZED DATA
, to review the option value for these you’d need to look in the database and get the value, then unserialize it - As transients are stored as options, these may make up a good chunk of the options, these usually contain
transient
in the option name
Summary
Using this hidden page is great for quickly reviewing what options are stored and their corresponding values, but remember that you should only change the values using this method if you are 100% sure what the option values should be.