WordPress Bits

Hacking WordPress. Keeping the bits together.

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 .

All WordPress Options on a single screen

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.

56 Responses to “Quick access to WordPress options”

  1. 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?

  2. radiohode said

    If it only was easy to upgrade from version 2.1.x to 2.2.x….

  3. 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

  4. […] 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 […]

  5. […] 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. […]

  6. Titanas said

    How can we remove some old plugins options from this page [meaning the DB i guess]?

  7. […] Quick access to WordPress options Etiketler: ayarlar, options, WordPress, yönetim paneli […]

  8. Mentality said

    I have yet to upgrade all of my blogs with the update. I think I’m going to do that right now…

  9. Jonathan said

    That’s a dandy little tidbit. I’m going to go try it!

  10. Jonathan said

    One question: what’s with the “rss_” keys followed by a huge alphanumeric array?

  11. […] [via WordPress Bits] […]

  12. 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.

  13. […] Quick access to WordPress options « WordPress Bits One screen with all of your WordPress options — very convenient. (tags: blogging) […]

  14. […] 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 […] […]

  15. 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.

  16. […] Fuente: WordPress Bits […]

  17. 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.

  18. 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.

  19. 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. :)

  20. satoridork said

    @ Radiohode
    Have a look at this thread from WordPress support forum.

  21. 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.

  22. 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?

  23. 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.

  24. 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.

  25. 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.

  26. 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. :)

  27. 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!

  28. […] 管理画面ダッシュボードのニュースに最近追加された WordPress Bits の Quick access to WordPress options « WordPress Bits よると、wp-adminディレクトリにあるoptions.phpを直接開くと WordPress […]

  29. […] Posts Quick access to WordPress optionsA look at WordPress filters. Disable wpautop() on post formatting.Home and the rest of main menu on […]

  30. […] WordPress – Quick access to WordPress options  […]

  31. dd32 said

    I think the option registration functionality is the solution.

    Hopefully someday the WP developers will have the time to spend on this.

    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)

  32. 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.

  33. […] 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 […]

  34. […] Quick access to WordPress options – Alle WP-instillinger pÃ¥ én side […]

  35. […] 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 . […]

  36. 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?

  37. Daryl,

    If your web site’s administration is at http://yoursite.com/wp-admin , then go to http://yoursite.com/wp-admin/options.php . :)

  38. […] 節錄翻譯自:Quick access to WordPress options […]

  39. […] 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 […]

  40. […] [via WordPress Bits] […]

  41. […] 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 […]

  42. […] WordPress Bits bin ich auf eine interessante Option in WordPress aufmerksam geworden. Es gibt eine Mglichkeit […]

  43. […] découvrant l’article de Leonid Mamchenkov sur la possibilité de manipuler l’intégralité des options pour WordPress sur une seule […]

  44. […] WordPress Bits bin ich auf eine interessante Sache aufmerksam geworden. Es gibt eine Möglichkeit alle […]

  45. […] WordPress Bits bin ich auf eine interessante Sache aufmerksam geworden. Es gibt eine Möglichkeit alle […]

  46. […] 節錄翻譯自:Quick access to WordPress options […]

  47. 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 :)

  48. Mittineague,

    Looks good :)
    Thanks for the link.

  49. […] Quick access to WordPress options « WordPress Bits […]

  50. 001Dark said

    hi i’m from russia :)
    u blog cool useful, may post u inf. on my site ?

  51. 001Dark,

    yes, sure.

  52. […] 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. […]

  53. PJ Brunet said

    Thanks for pointing out this file. I really wish there was an “export” and “import” option.

  54. Dergi said

    thx for the link

  55. 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/)

  56. […] Kaynak: Quick access to WordPress options […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: