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.

53 Responses to “Quick access to WordPress options”

  1. Mihai Says:

    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 Says:

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

  3. Derek Burress Says:

    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. Accede rápidamente a todas las opciones de tu Wordpress | aNieto2K Says:

    [...] 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. Wszystkie opcje WordPress’a at ITblog Says:

    [...] 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 Says:

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

  7. yakuter » Wordpress Ayarlarına Direk Erişim Says:

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

  8. Mentality Says:

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

  9. Jonathan Says:

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

  10. Jonathan Says:

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

  11. gidibao’s Cafe | wordpress options Says:

    [...] [via WordPress Bits] [...]

  12. Jared Schwager Says:

    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. Column 2 : links for 2007-08-07 Says:

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

  14. Top Posts « WordPress.com Says:

    [...] 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 Says:

    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. Acceso rápido a todas las opciones de Wordpress | albertferran Says:

    [...] Fuente: WordPress Bits [...]

  17. Leonid Mamchenkov Says:

    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. Leonid Mamchenkov Says:

    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. Leonid Mamchenkov Says:

    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 Says:

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

  21. Carson Sasser Says:

    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 Says:

    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. Leonid Mamchenkov Says:

    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. Leonid Mamchenkov Says:

    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 Says:

    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. Leonid Mamchenkov Says:

    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 Says:

    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 の設定一覧を表示する | わーどぷれすっ! Says:

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

  29. A look inside the WordPress database « WordPress Bits Says:

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

  30. Famous last words of Marius » RSS feed update - 9 August 2007 Says:

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

  31. dd32 Says:

    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. Leonid Mamchenkov Says:

    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. Automating WordPress customizations - the plugin way « WordPress Bits Says:

    [...] 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. shevy.dk » Mine del.icio.us-links den 9. august Says:

    [...] Quick access to WordPress options - Alle WP-instillinger på én side [...]

  35. Bookmarks for Friday, August 10th — Trevor Fitzgerald Says:

    [...] 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 Says:

    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. Leonid Mamchenkov Says:

    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. 彥哥 & 小公主 » Blog Archive » 快速存取Wordpress所有選項設定 Says:

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

  39. WordPress Options follow-up « WordPress Bits Says:

    [...] 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. programmazione » Blog Archive » WordPress Options: tutte le opzioni da una sola pagina Says:

    [...] [via WordPress Bits] [...]

  41. Navigating WordPress source code « WordPress Bits Says:

    [...] 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-Einstellungen auf einer Seite » Peruns Weblog Says:

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

  43. Nettoyage de la base de données WordPress | Asbel.be Says:

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

  44. Web 2.0 Blog » Blog Archive » - aus dem Blog:WordPress-Einstellungen auf einer SeitePeruns Weblog[Quelle] Says:

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

  45. Web 2.0 Blog » Blog Archive » WordPress-Einstellungen auf einer Seite - aus dem Blog:Peruns Weblog[Quelle] Says:

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

  46. 彥哥 & 小公主 » Blog Archive Says:

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

  47. Mittineague Says:

    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. Leonid Mamchenkov Says:

    Mittineague,

    Looks good :)
    Thanks for the link.

  49. Plugin Housekeeping « A Guilty Pleasure Says:

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

  50. 001Dark Says:

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

  51. Leonid Mamchenkov Says:

    001Dark,

    yes, sure.

  52. Cotralis » Blog Archive » A look inside the WordPress database Says:

    [...] 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 Says:

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

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>