Quick access to WordPress options
Posted by Leonid Mamchenkov on August 7, 2007
One of the first things that you probably check right after upgrade to a new WordPress version is the Options menu in the administration interface. Is there something new? Are there more ways that WordPress can be tweaked and tuned now? Can I … Anyway, I don’t have to tell you about it. You know.
But what you probably don’t know is that there is a quick way to see all WordPress options on one screen. Even those that aren’t accessible through the Options menu interface. And not only that, but you can even edit all those options at once.
To access the page with all options, go to your administration interface, and append options.php to the URL, so that it looks something like http://domain/blog/wp-admin/options.php .

We will come back one day to this topic to see how this can be useful (hint: plugin development). Until then remember that it is pretty easy to break and destroy your WordPress installation buy editing these options directly. You should stick to the regular interface of the Options administration. Be warned.
Update: Obviously, I left out the most interesting part - how to do a cleanup of old options, left by plugin installations. All these options are stored in wp_options table in your WordPress database. You can use your favorite MySQL administration tool (be that mysql command or PHPMyAdmin or something else) to remove the rows which you are totally sure you don’t need. You can either use “DELETE FROM wp_options WHERE option_name = ’some_option’” SQL statement, or a bit safer version - “SELECT option_id,option_name FROM wp_options WHERE option_name = ’some_option’” to find out the ID of the option, and then “DELETE FROM wp_options WHERE option_id = XX” (substitute XX with option ID that you find in the previous query). Note that these SQL queries assume that the prefix of your WordPress tables is “wp_”. You should change table names in the queries accordingly, if you use a different prefix.
August 7, 2007 at 4:16 pm
Hello and thanks for this great tip. I have options lefted by plugins that I uninstall, so they are no longer available in my wp directory. Can I delete this lines in the options.php file?
August 7, 2007 at 5:01 pm
If it only was easy to upgrade from version 2.1.x to 2.2.x….
August 7, 2007 at 5:10 pm
I tried this for the very first time since reading your article and noticed that there were a bunch of fields there which came from old plugins and themes that I no longer use on my site.
I have a question as a result… how do you clear the options and remove all the data that is no longer being used in the options folder without affecting the stuff that you are currently using?
Thanks:
Derek Burress
August 7, 2007 at 5:12 pm
[...] necesitas conocer todas las opciones y parámetros que condicionan tu WordPress, puede verlas mediante un acceso directo al fichero options.php de la carpeta [...]
August 7, 2007 at 6:00 pm
[...] Takie cudeńko dziś znalazłem podczas popołudniowej lektury RSS’ów. Jest taki tajny/poufny adres/plik, gdzie można podglądanąć sobie wszystkie opcje naszego silnika blogowego. [...]
August 7, 2007 at 6:54 pm
How can we remove some old plugins options from this page [meaning the DB i guess]?
August 7, 2007 at 6:56 pm
[...] Quick access to WordPress options Etiketler: ayarlar, options, WordPress, yönetim paneli [...]
August 7, 2007 at 8:42 pm
I have yet to upgrade all of my blogs with the update. I think I’m going to do that right now…
August 7, 2007 at 10:01 pm
That’s a dandy little tidbit. I’m going to go try it!
August 7, 2007 at 10:06 pm
One question: what’s with the “rss_” keys followed by a huge alphanumeric array?
August 7, 2007 at 10:16 pm
[...] [via WordPress Bits] [...]
August 7, 2007 at 10:24 pm
Thanks for this little tip. I had a lot of old preferences from plugins I don’t use any more. I have since done some spring cleaning of those preferences in the MySQL database.
August 7, 2007 at 11:29 pm
[...] Quick access to WordPress options « WordPress Bits One screen with all of your WordPress options — very convenient. (tags: blogging) [...]
August 7, 2007 at 11:59 pm
[...] Quick access to WordPress options One of the first things that you probably check right after upgrade to a new WordPress version is the Options menu in […] [...]
August 8, 2007 at 2:28 am
I was wondering what I’d uncover with just typing options.php, but never bothered to try it. Thanks for the tip, this seems really interesting.
August 8, 2007 at 4:53 am
[...] Fuente: WordPress Bits [...]
August 8, 2007 at 7:10 am
OK guys, sorry for leaving the most interesting part out. I now updated the post with instructions on how to remove old and unused options.
August 8, 2007 at 7:13 am
Radiohode,
what difficulties do you face in the upgrade process? I don’t remember any myself. Maybe it was too long ago or maybe I didn’t have any. :)
Just in case, here are the places where you can find help.
August 8, 2007 at 7:15 am
Jonathan,
hmm… on my WP installations, all rss_ options are either single values or “SERIALIZED DATA”, which probably means that there is no sane way to show the value of the option. :)
August 8, 2007 at 10:39 am
@ Radiohode
Have a look at this thread from WordPress support forum.
August 8, 2007 at 12:20 pm
Let me see if I got the gist of your post: There’s a cool way to access all of the WordPress options — but we shouldn’t use it. Yet, the most interesting part is a way to dick around with the options table directly.
August 8, 2007 at 12:28 pm
I think it would be a great plugin to cross-reference all installed plugins (or perhaps even have the option to include plugins installed, but not activated, as well) and have the option to delete all the rows in the Options table that are no longer used.
Is this a complicated idea? I’d been wanting a plugin like this for a while to tidy things up.
Is there a need for this type of plugin. Would it actually help speed up load times?
August 8, 2007 at 12:33 pm
Carson,
you got it right. :)
But the real reason for the post is ground preparation. I am writing a few posts now about plugin development for WordPress. I’ll be referencing this post.
August 8, 2007 at 12:36 pm
Laundro,
it’ll be way to complicated to implement, as there is no mechanism now for plugins to tell if they are using an option or not. And it won’t save you much anyway. How many records are there in your wp_options table? :)
I have a couple of web sites which were through a few hundred plugins already, but have less then 200 options in DB. Remember that not all plugins use options.
August 8, 2007 at 12:56 pm
Rows 1,026
Row length ø 1,711
Row size ø 1,765 B
But the option_id is up to 1889.
But
I kinda am a plugin hog. At least in trying them out. I only actually use 10-20 plugins at a time.
August 8, 2007 at 1:06 pm
Laundro,
I hear some power users of Windows operating system use this approach to keep their system clean - before they install or update any software, they do a snapshot of their filesystem and system registry. When they uninstall the software or downgrade, they restore the system to the appropriate snapshot.
You could use similar approach for the WordPress Options. Get a snapshot of the wp_options table before you install a new plugin. Restore to this snapshot when you remove the plugin. This will work only if no other options were changed between install/uninstall. Otherwise, you’ll come back to the original option value. ;)
As you can see, this is very fragile. Parsing plugin source code for “add_option/update_option” is even more broken.
The only right way to solve this problem that I can think of right now, is for WordPress to include option registration functionality for plugins. This way, once plugin is deactivated/removed, all its options are cleaned out.
You can suggest this idea at wp-hackers mailing list or any other appropriate place, where WordPress developers hang out. :)
August 8, 2007 at 1:29 pm
I think the option registration functionality is the solution.
Hopefully someday the WP developers will have the time to spend on this.
Thanks!
August 8, 2007 at 4:35 pm
[...] 管理画面ダッシュボードのニュースに最近追加された WordPress Bits の Quick access to WordPress options « WordPress Bits よると、wp-adminディレクトリにあるoptions.phpを直接開くと WordPress [...]
August 8, 2007 at 5:33 pm
[...] Posts Quick access to WordPress optionsA look at WordPress filters. Disable wpautop() on post formatting.Home and the rest of main menu on [...]
August 9, 2007 at 6:13 am
[...] WordPress – Quick access to WordPress options [...]
August 9, 2007 at 8:30 am
Personally i think plugin authors should clean up after their plugins.
When the plugin is deactivated(The plugin can tell if its about to be deactivated), then it should probably issue “delete_option(’option_name’)” for any options it has.. Unfortunately however, Not many plugins would want to do this.
Why? Well.. If you deactivate a plugin for a short time, its going to be a pain when you re-enable it to find out it cleared out all your settings, and you have to go through and re-enable each one.
Maybe WP could just change the “Autoload” option to false when the plugin is disabled? (via a API which plugins register their options)
August 9, 2007 at 8:37 am
dd32,
exactly! That’s why I think plugin option registration is the way to go. Once this is in place and all options are registered to their plugins, there can be a button like “Clean-up options”. The user will know when is the right time to press it, and it will be trivial for WordPress to know what to clean out and what not.
Obviously, it’s not such a huge problem for now.
August 9, 2007 at 9:26 am
[...] Posts A look inside the WordPress databaseQuick access to WordPress optionsA look at WordPress filters. Disable wpautop() on post formatting.Home and the rest of main menu on [...]
August 10, 2007 at 3:31 am
[...] Quick access to WordPress options - Alle WP-instillinger på én side [...]
August 11, 2007 at 3:38 am
[...] Quick access to WordPress options « WordPress Bits - To access the page with all options, go to your administration interface, and append options.php to the URL, so that it looks something like http://domain/blog/wp-admin/options.php . [...]
August 11, 2007 at 2:07 pm
Being absolutely brand new to both WordPress and PHP I’m lost as to where exactly the (screen shown -tiny) above is located in the options of WordPress - ***** and append options.php to the URL ******* I want to try this but cant seem to find where to add or change…..? I hope everyone reading this doesnt get crazy at me but I’m really new… ;-( Some kind of pointer would help I’ve downloaded and installed WP2.2 Where is all this at?
August 11, 2007 at 6:05 pm
Daryl,
If your web site’s administration is at http://yoursite.com/wp-admin , then go to http://yoursite.com/wp-admin/options.php . :)
August 12, 2007 at 5:51 am
[...] 節錄翻譯自:Quick access to WordPress options [...]
August 12, 2007 at 4:10 pm
[...] on Hello world!David on Having fun with WordPress logi…彥哥 & 小公… on Quick access to WordPress opti…Leonid Mamchenkov on Having fun with WordPress logi…wangjel on Having fun with WordPress [...]
August 13, 2007 at 7:58 pm
[...] [via WordPress Bits] [...]
August 14, 2007 at 10:57 am
[...] Top Posts WordPress Options follow-upHaving fun with WordPress login. Box or not.Cleaning up after the WordPress widget partyAutomating WordPress customizations - the plugin wayQuick access to WordPress options [...]
August 15, 2007 at 3:59 am
[...] WordPress Bits bin ich auf eine interessante Option in WordPress aufmerksam geworden. Es gibt eine Mglichkeit [...]
August 19, 2007 at 11:45 pm
[...] découvrant l’article de Leonid Mamchenkov sur la possibilité de manipuler l’intégralité des options pour WordPress sur une seule [...]
September 1, 2007 at 4:01 pm
[...] WordPress Bits bin ich auf eine interessante Sache aufmerksam geworden. Es gibt eine Möglichkeit alle [...]
September 1, 2007 at 4:44 pm
[...] WordPress Bits bin ich auf eine interessante Sache aufmerksam geworden. Es gibt eine Möglichkeit alle [...]
September 16, 2007 at 6:59 am
[...] 節錄翻譯自:Quick access to WordPress options [...]
September 21, 2007 at 1:55 am
I wrote the Clean Options plugin specifically to provide WordPress blogs with the ability to screen and remove unused options from the options table.
It not only provides a way to remove unused plugin options, but also the cached “rss_” options.
Enjoy :)
September 21, 2007 at 9:57 am
Mittineague,
Looks good :)
Thanks for the link.
October 30, 2007 at 4:57 pm
[...] Quick access to WordPress options « WordPress Bits [...]
November 27, 2007 at 12:31 am
hi i’m from russia :)
u blog cool useful, may post u inf. on my site ?
November 27, 2007 at 12:33 am
001Dark,
yes, sure.
February 26, 2008 at 8:57 pm
[...] but we’ll leave them for now, as we did with other tables.wp_optionsAs we saw in update to “Quick access to WordPress options” post, wp_options is the table that holds all the global options for your WordPress installation. [...]
June 9, 2008 at 10:59 pm
Thanks for pointing out this file. I really wish there was an “export” and “import” option.