Want to update value in database. But it says update() on null

Your verify.php files lives outside WordPress framework, so $wpdb and everything else is not available. Correct way is to use admin_post_ hook. You can read about it here. This goes in functions.php add_action( ‘admin_post_add_foobar’, ‘prefix_admin_add_foobar’ ); function prefix_admin_add_foobar() { //$wpdb->update() } And the form: <form action=”<?php echo esc_url(admin_url(‘admin-post.php’)); ?>” method=”post”> <input type=”hidden” name=”action” value=”add_foobar”> <input … Read more

How to optimize wp_option table?

If you Google for “wp_options optimize” you’ll find some suggestions how to search for performance problems in wp_options. It makes sense to check which option values are very big, using the following query. Then check if you really need the plugin that wrote this setting (or remove the setting(s), if the plugin already is installed). … Read more

update to a new template without loosing any data

Look in Tools, Export on the Admin screen. You can specify what to export (posts, images, pages), and then Tools, Import to get the posts into the new site. This process is different than ‘cloning’ tools (my favorite is WP Clone). Some cloning plugins will allow you to specify only posts/images/whatever.

Not sure what to do next to optimize

It might be useful to analyze where the bottleneck is in rendering pages. Use the Developer mode of your browser (usually via F12) and then use the Network tab to see the load times of the various parts of the page. Maybe the problem is in images, or ‘off-site’ Javascript code, or any other off-site … Read more

Set SQL_BIG_SELECTS and MAX_JOIN_SIZE on a WP_Query

According to WP_Query hit max joins… How else can I build a search function that uses custom fields? you should use $wpdb->query(‘SET OPTION SQL_BIG_SELECTS = 1’); which makes sense as you set it for the current connection. You create a separate connection through new mysqli and WordPress has another on $wpdb.