It depends on content and context.
Options with autoload = yes
are loaded very early, all in one query. This is pretty fast, but it might be too early when an options contains a serialized object whose class isn’t loaded yet.
Options with autoload = no
are loaded when get_option()
is called.
Use yes
when …
- ( you need the option on (almost) every page load or
- you don’t know when you will need the option or
- the option value is very small )
and - the value is not a serialized object
Use no
in all other cases, or refactor the code to make it “yes-compatible”.
You have to weight the number of database requests against the size of the transferred content. When in doubt, measure both.
Related Posts:
- WP_Options ID high
- Multiple wp_options tables to share content across installs
- What structure and database storage method should I use for temporary storage that may be written concurrently?
- Will it break my site if I delete all transient records in wp_options table?
- Please explain how WordPress works with MySQL character set and collation at a low level
- What is the purpose of the option name hack_file in the options table?
- WordPress database scalability from the code perspective
- delete_option() and update_option() returning false
- How to change option recently_edited?
- Performance tips for a large user base [closed]
- store simple data in get_option()
- Transient RSS feeds in wp_options not removed automatically?
- WordPress for a very large website
- WordPress database becoming huge. How to analyze and optimize it? fear of running out of memory
- Improve or optimize a very slow query
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- Long option names fail silently?
- save new data to wp_options non-post form
- Efficiency on displaying random authors based on large database
- How to solve slow WordPress site caused by attachment_metadata
- Huge wp_options table
- Cannot unserialize WordPress serialized values in `wp_options` table?
- Relationship between performance and database size
- WordPress DB: options-table –> 32 gzipcompression?
- Database slowdown after update to 3.4.1
- wp_options table has duplicate rows and primary key / autoincrement has been removed
- Help running a MySQL query to update all wp_#_options tables in a Multisite install
- What ALL can cause “Another update is currently in progress.”? [closed]
- wp_redirection_404 table has grown to 7GB
- Should I remove transients from the wp_options table?
- I don’t see site_url and home_url fields in wp_options table (phpMyAdmin)?
- Which is more efficient? Using usermeta, or creating a new MySQL table?
- Accidentally deleted active_plugins portion of the wp_options DB table
- One post carries 30 postmeta values, is this too much?
- batch UPDATE autoload value in wp_options table
- Improve performance by removing unnecessary database queries
- fastest replacement DB
- How to prevent/delay MySQL connections when an object cache is used?
- Is there an atomic way to update_option in WordPress (to ensure data integrity)?
- Check if an option exists and get its value in one hit
- How to combine multiple wp_insert_post into one in order to gain better performance
- My options table is huge. What can I do?
- Change options table prefix only
- When to use custom DB tables or add_option?
- In which format the data is stored in WordPress Databases?
- Automate WordPress website setup with prefilled data
- Optimizing function that automatically creates internal links based on post title string
- Image link issues after importing a database backup to my local web server
- Native timestamp on wp_options option
- Is there anyway to split posts to different databases?
- Whats the best practise on how to store json data from a custom settings page?
- Job and Employee Performance Tracking with Product Safety
- WordPress Settings API Overrides My Previous Value
- Get all top categories, then only 3 posts for each
- Best way to store 1 billion+ posts?
- Optimize WP site for millions of posts
- get_option() does unserialize and don’t remove \
- Counting user’s comments – efficient way?
- Performance bug – slow DB query
- I cannot change anything in my wordpress database from within wordpress?
- Mysql Queries per Visit – Crazy High
- Wrong url for the images while using same database for two WordPress installations
- Options table – where does my values go?
- Theme options not being sent to Database
- Is saving multiple options or saving multiple items in one option better?
- Multiple Address In WP-Option Value
- How do I use update_option to give me a new option name each time a form is submitted? [duplicate]
- Update Option Stored in Multi-Dimensional Array
- Syncing local content with development / staging sites
- Export WP database for import using WP-CLI on Vagrant Box
- WordPress page title repeated in SOME pages
- How to correctly add a table to the WordPress MySQL database
- Is it safe to convert tables from MyISAM to InnoDB?
- Use one WordPress database with multiple instances of one site
- How do I properly update the WordPress database password?
- $wpdb->insert is not working
- Using GROUP CONCAT in my-sql query with wp_usermeta table
- How to move the WordPress site Layout from test site to Production site?
- Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- Retrieve data from the database to table such as comments in the admin control panel
- Need to store custom user information (many-many relationsips), preferably not as user meta
- charset problem with new custom table
- How to share plugin created database tables between two WordPress sites
- How to connect to a remote database in WordPress?
- Form that sends data to an admin panel and can export it
- Convert user passwords to MD5?
- How to backup my site and restore my wordpress site
- How get Data form wordpress database as array not stdclass?
- cannot connect database
- How do I have a user upload a blog post and then retrieve that to display in a card on the site?
- Delete user with only subscriber role
- How to rename custom table name programatically in wordpress?
- pre_get_posts causings DB error when using ( ‘posts_per_page’, -1)?
- generate PDF from member information
- Help posting values to DB on submit using $wpdb->query
- Creating a database in my plugin not working
- How to create index (sql) to a meta_key?
- get_user_meta and umeta_id
- $wpdb not working
- Simple email input store in database