Concurrent / simultaneous MySQL connections

IMHO that would depend on the hosting company and what resources you are limited to. Let’s say you pick Amazon’s MySQL RDS. There are seven server models permitted. Each model allows a maximum value for the number of connections. I wrote a post about this last month in the DBA StackExchanage : Should I increase … Read more

Query WordPress database by registered date and role

I’m no SQL expert, but I think it would look something like this: SELECT * FROM mydatabase.wp_users INNER JOIN mydatabase.wp_usermeta ON (wp_users.ID = wp_usermeta.user_id) WHERE 1=1 AND wp_users.user_registered > ‘2014-03-15 00:00:00’ AND wp_users.user_registered < ‘2014-03-16 00:00:00’ AND ( (wp_usermeta.meta_key = ‘wp_capabilities’ AND CAST(wp_usermeta.meta_value AS CHAR) LIKE ‘%\”subscriber\”%’) ) ORDER BY user_registered ASC ;

Using $wpdb Class to Pull Recent Comments Across a Network

Why not use get_comments(), instead of trying to roll your own with $wpdb? function display_sitewide_comments() { $sites = wp_get_sites(); $network_comments = array(); $max = 20; foreach( $sites as $site ) { switch_to_blog( $site->blog_id ); $args = array( ‘number’ => $max, ‘status’ => ‘approved’, ); $network_comments[$site->blog_id] = get_comments( $args ); restore_current_blog(); } // inspect the comments … Read more

Replace existing pages with new pages, keep menu links

I was shocked to see that such a simple thing is not readily supported. I was even more shocked to see that no one had a good answer here on StackExchange! Happily, I found this post: https://wordpress.org/support/topic/updating-current-page-with-new-built-page/ …and am grateful for the answer provided by Joy (@joyously on WordPress.org and Slack) “If you need to … Read more

How to bulk edit canonical url’s in SQL?

Down- and uploading CSVs is a tough one that forces you to make a bunch of steps manually which is prone to human error (and typos). My suggestion would be to do something that you can battletest locally in a local copy of your DB. Steps to follow: Make a database dump using the mysqldump … Read more