update_option()
does this for you already:
// If the new and old values are the same, no need to update.
if ( $value === $old_value )
return false;
No need to worry about it. 🙂
Note that if you have a lot of options, which are not autoloaded, this might cause excessive read queries. This applies to general operation too, not just updates.
Related Posts:
- clean wp_options table unused rows
- Remove obsolete plugins artifacts from database tables
- Default Plugin Settings Not Writing to Database
- Where does WordPress store plugin (enabled/disabled) status for multisite?
- How to remove traces from widget during uninstallation
- wp_editor content in plugin options page
- Gathering and logging data from a plugin: how to do it without race conditions?
- How to add a custom form to a plugin’s setting page
- update_option creates an option, which empties on a blog reload
- Enable plugins that are “not supported”
- database – multiple wordpress installations using same database – can they share plugin settings?
- Is saving multiple options or saving multiple items in one option better?
- How to find an option in the database?
- WordPress and a secondary database?
- WordPress plugin creating database in localhost but not on real host
- Why this function not working for install database on plugin activation
- options creation for plugins
- plugin code is pulling information from database in one instance and not in other. What is wrong?
- “Master” WordPress Multisite – Database Sync
- Better ads plugin has 500.000 entries in wp_postmeta
- How to create an option page for this simple plugin
- Redirect to another page using contact form 7? [closed]
- How to create multiple database tables on plugin activation?
- Can I create a table on my DB without creating a plugin?
- get_option error plugin development
- WordPress : Explain Plugins & Theme string value in database
- Is it necessary to auto delete my WP plugin database tables when users deactivate/delete my plugin?
- Does deleting a Plugin via the WordPress admin ‘completely’ remove the code?
- Creating a CSV with PHP inside the plugin directory
- Plugins in WP_Options but not Active
- after wordpress update to 3.5+ i get many errors in plugin wpdb::prepare()
- How do i edit the plugin files in DataBase via phpMyAdmin?
- WordPress as a data-store?
- How to insert and call new data in wordpress website database through a plugin
- How to pass the API key to the client from the database? [closed]
- WPDB: Update table
- Update a core option from plugin settings page
- WordPress error: Options page Setting_ not found in the allowed options list
- Issue running db create table query from static method
- Problem of encoding characters (apostrophes) in my posts publications
- Separate database for a wordpress plugin
- Is there a rule for wordpress plugins developers to not do any database changes upon update?
- Can I use register_settings and unregister_setting once the settings page has loaded?
- How to keep variable `$post` to using in another file
- dbDelta not adding additional columns in plugin database update
- update_option_{$option} not showing old value
- Can deactivating a plugin sometimes “reset” settings within that plugin?
- Allowed memory size exhausted problem
- Change the style of h1, h2, only in post entry
- Plugin getting Cannot modify header information errors
- How to add options to the plugin page?
- Saving widget options from class method
- Making my plugin create a page?
- Ajax save data to database on document ready, no data being saved
- How to prevent plugins from sniffing/stealing other plugins’ options?
- Add some fileds to the wp_posts table
- How to edit a published post?
- Default plugin config to override wp_options?
- Best/Correct way to add an option to a category
- Plugin has added weird data in wp_options, set to autoload
- Always get creating a new table with foreign key
- How to do database for download stats?
- What is the WordPress approach to custom data?
- get_option / wp_localize_script Not Working in OOP Plug In
- How to create plugin/ page that reads from database
- How retreive saved data from gravity forms in my template?
- OceanWP settings are missing from Add New Post [closed]
- Change in one place the data about the company, which are placed on several pages
- DB Query not working in Plugin
- Assign all Post in Wp to a specific Category
- Plugin scheduled event not working
- External wpdb connections in different plugins on single page
- Update WP option by plugin
- How to save plugin custom settings page fields
- Storing The Data Collected by Ninja Forms into Another (custom) Database [closed]
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Where do plugin variables live in the db?
- How to reinstate previously saved option?
- WordPress plugin boilerplate table create
- How (or where) do I get wordpress plugin update download link?
- Adding option values as an array using a multi selectable select box
- Store plugin page content in wp_options?
- How to relate 3 wordpress components with each other (Create database relationships)
- Creating a search form and displaying results
- WordPress plugin: efficient way to store large data
- Every time I save my plugin options it erases another plugin options
- How can I store data from custom fields to custom tables?
- Changing plugin options from theme functions file?
- Adding a theme option to the admin that lets me turn on/off a javascript file
- How to make a textarea accept javascript in my settings apge?
- Plugin: connect to external database without showing password
- How to access the WordPress DB from a plugin file
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version [closed]
- How do you add a settings page to another menu?
- Storing Form data in a different database
- Is this plugin safe to run?
- Localise settings section headline
- Integrating Custom Database with WordPress
- How to display results from a data table with an encrypted user id?
- Need to add/remove group of options and display them as rows