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.
This entry was posted on August 7, 2007 at 3:02 pm and is filed under Options, WordPress. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Mihai said
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?
radiohode said
If it only was easy to upgrade from version 2.1.x to 2.2.x….
Derek Burress said
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
Accede rápidamente a todas las opciones de tu Wordpress | aNieto2K said
[…] 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 […]
Wszystkie opcje WordPress’a at ITblog said
[…] 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. […]
Titanas said
How can we remove some old plugins options from this page [meaning the DB i guess]?
yakuter » Wordpress Ayarlarına Direk Erişim said
[…] Quick access to WordPress options Etiketler: ayarlar, options, WordPress, yönetim paneli […]
Mentality said
I have yet to upgrade all of my blogs with the update. I think I’m going to do that right now…
Jonathan said
That’s a dandy little tidbit. I’m going to go try it!
Jonathan said
One question: what’s with the “rss_” keys followed by a huge alphanumeric array?
gidibao’s Cafe | wordpress options said
[…] [via WordPress Bits] […]
Jared Schwager said
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.
Column 2 : links for 2007-08-07 said
[…] Quick access to WordPress options « WordPress Bits One screen with all of your WordPress options — very convenient. (tags: blogging) […]
Top Posts « WordPress.com said
[…] 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 […] […]
BoltClock said
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.
Acceso rápido a todas las opciones de Wordpress | albertferran said
[…] Fuente: WordPress Bits […]
Leonid Mamchenkov said
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.
Leonid Mamchenkov said
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.
Leonid Mamchenkov said
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. :)
satoridork said
@ Radiohode
Have a look at this thread from WordPress support forum.
Carson Sasser said
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.
Laundro said
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?
Leonid Mamchenkov said
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.
Leonid Mamchenkov said
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.
Laundro said
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.
Leonid Mamchenkov said
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. :)
Laundro said
I think the option registration functionality is the solution.
Hopefully someday the WP developers will have the time to spend on this.
Thanks!
WordPress の設定一覧を表示する | わーどぷれすっ! said
[…] 管理画面ダッシュボードのニュースに最近追加された WordPress Bits の Quick access to WordPress options « WordPress Bits よると、wp-adminディレクトリにあるoptions.phpを直接開くと WordPress […]
A look inside the WordPress database « WordPress Bits said
[…] Posts Quick access to WordPress optionsA look at WordPress filters. Disable wpautop() on post formatting.Home and the rest of main menu on […]
Famous last words of Marius » RSS feed update - 9 August 2007 said
[…] WordPress – Quick access to WordPress options […]
dd32 said
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)
Leonid Mamchenkov said
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.
Automating WordPress customizations - the plugin way « WordPress Bits said
[…] 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 […]
shevy.dk » Mine del.icio.us-links den 9. august said
[…] Quick access to WordPress options – Alle WP-instillinger pÃ¥ én side […]
Bookmarks for Friday, August 10th — Trevor Fitzgerald said
[…] 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 . […]
Daryl I said
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?
Leonid Mamchenkov said
Daryl,
If your web site’s administration is at http://yoursite.com/wp-admin , then go to http://yoursite.com/wp-admin/options.php . :)
彥哥 & 小公主 » Blog Archive » 快速存取Wordpress所有選項設定 said
[…] 節錄翻譯自:Quick access to WordPress options […]
WordPress Options follow-up « WordPress Bits said
[…] 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 […]
programmazione » Blog Archive » WordPress Options: tutte le opzioni da una sola pagina said
[…] [via WordPress Bits] […]
Navigating WordPress source code « WordPress Bits said
[…] 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 […]
WordPress-Einstellungen auf einer Seite » Peruns Weblog said
[…] WordPress Bits bin ich auf eine interessante Option in WordPress aufmerksam geworden. Es gibt eine Mglichkeit […]
Nettoyage de la base de données WordPress | Asbel.be said
[…] découvrant l’article de Leonid Mamchenkov sur la possibilité de manipuler l’intégralité des options pour WordPress sur une seule […]
Web 2.0 Blog » Blog Archive » - aus dem Blog:WordPress-Einstellungen auf einer SeitePeruns Weblog[Quelle] said
[…] WordPress Bits bin ich auf eine interessante Sache aufmerksam geworden. Es gibt eine Möglichkeit alle […]
Web 2.0 Blog » Blog Archive » WordPress-Einstellungen auf einer Seite - aus dem Blog:Peruns Weblog[Quelle] said
[…] WordPress Bits bin ich auf eine interessante Sache aufmerksam geworden. Es gibt eine Möglichkeit alle […]
彥哥 & 小公主 » Blog Archive said
[…] 節錄翻譯自:Quick access to WordPress options […]
Mittineague said
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 :)
Leonid Mamchenkov said
Mittineague,
Looks good :)
Thanks for the link.
Plugin Housekeeping « A Guilty Pleasure said
[…] Quick access to WordPress options « WordPress Bits […]
001Dark said
hi i’m from russia :)
u blog cool useful, may post u inf. on my site ?
Leonid Mamchenkov said
001Dark,
yes, sure.
Cotralis » Blog Archive » A look inside the WordPress database said
[…] 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. […]
PJ Brunet said
Thanks for pointing out this file. I really wish there was an “export” and “import” option.
Dergi said
thx for the link
Meher said
Hi
A very good tutorial. I have a couple of questions regarding the wp_option table.
1) When installing WordPress for the first time on local computer, in the wp_option table – there is a column name called “option_name”. In that there is a record which is “_transient_random_seed”. What is the “_transient_random_seed”????? How is it generated???
2) I took a backup of my online websites database and restored it on to my local computer. After doing that I checked the wp_option table and could not find the “_transient_random_seed” record in that table??? please may I know the reason why?
Regards,
Meher
(http://www.opensourcevarsity.com/)
WordPress Ayarlarına Direk Erişim | ProfTm | Ve Biraz Teknoloji... said
[…] Kaynak: Quick access to WordPress options […]