Bulk delete users by role? SQL?

This can be done efficiently with a SQL query, but it won’t be so easy to set it up. It would have to delete the users, its meta data, to reassign their associated posts, etcetera. As it is an operation that will run only once and will not have any long-lasting performance impact, I think … Read more

Moving post’s content to post’s comments section

Most CMS migration/data import tools for WordPress rely on some degree of access to the original data types and store – e.g. the discrete data related to posts, authors, and comments – which can then be fairly directly translated to WordPress’s counterparts. This particular case is considerably more involved since comments and authors have been … Read more

Replace a character in all post titles and slugs

Slugs are saved in the very same table but in the post_name column. So your query would look like this: UPDATE wp_posts SET post_name = REPLACE(post_name, ‘m’ , ‘p’) WHERE post_type=”post” AND post_status=”publish”; By the way, I’d suggest you to use $wpdb->posts instead of just wp_posts ( then it would be compatible with different prefixes, … Read more

Modify wording of bulk options

There’s currently no possibility to modify those. Just renaming it (the label in the UI only) via JS is possible. I’d recommend to not try to modify those strings, as they equal action names and therefore are part of the query strings. You might break things easily. Figuring out what causes things to brake a … Read more

Bulk delete WordPress posts with phpMyAdmin

The join isn’t that complex, but I wouldn’t bother with it. Since you have a lot to remove a direct SQL query will run a LOT faster than WP. However, we do need to keep track of the post ID numbers and remove the descendants and metadata. Not tested / Make a backup / your … Read more

UWooCommerce – add cart discount programmatically?

I haven’t applied any discounts like that before, but have done it with ‘fees’ a lot. Adding a fee is quite easy: function custom_wc_add_fee() { WC()->cart->add_fee( ‘Fee’, -10 ); } add_action( ‘woocommerce_cart_calculate_fees’,’custom_wc_add_fee’ ); (or if you want a plugin solution, I created this plugin: https://aceplugins.com/plugin/woocommerce-advanced-fees/)

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)