• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP Bitz

A curated collection of code snippets for WordPress

  • Home
  • About
  • Blog
  • Code Snippets
You are here: Home / Archives for Code Snippets

Decrease Password Strength Requirements for WooCommerce

June 17, 2020

/** * Change WooCommerce required password strength. * * WooCommerce password strength requirement is determined by an integer …

Continue Reading

Remove WooCommerce Password Strength Meter

June 17, 2020

add_action( 'wp_print_scripts', 'my_woo_remove_password_strength', 10 ); function my_woo_remove_password_strength() { …

Continue Reading

Set user role to WordPress default role during WooCommerce checkout

May 28, 2020

add_filter( 'woocommerce_new_customer_data', 'my_custom_user_data'); function my_custom_user_data( $new_customer_data ) { …

Continue Reading

Set custom user role during WooCommerce checkout

May 28, 2020

add_filter( 'woocommerce_new_customer_data', 'my_custom_user_data'); function my_custom_user_data( $new_customer_data ) { …

Continue Reading

Disallow spaces in WordPress usernames

May 6, 2020

add_filter( 'validate_username', 'my_no_space_username', 10, 2 ); /** * Checks to see if a username contains whitespace. * @see: …

Continue Reading

MySQL delete records in one table that do not exist in another table

April 19, 2020

DELETE FROM content_to_tags WHERE NOT EXISTS ( SELECT * FROM content WHERE content_id = content_to_tags.content_id ) …

Continue Reading

MySQL update column in one table with data from another table

April 19, 2020

update table1 t1 join table2 t2 on t2.field = t1.field set t1.field1 = t2.matchingfield where t1.whatever = t2.whatever …

Continue Reading

MySQL copy table data to a new table

April 18, 2020

CREATE TABLE backup_table LIKE existing_table; INSERT backup_table SELECT * FROM existing_table; …

Continue Reading

Get all WordPress user emails

April 13, 2020

$users = get_users(); foreach ( $users as $user ) { $email = $user->user_email; } …

Continue Reading

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 3
  • Page 4
  • Page 5
  • Page 6
  • Page 7
  • Go to Next Page »

Primary Sidebar

Join for free!

Get free code snippets, WordPress best practices, and practical Content Marketing advice from seasoned WordPress expert Chad Butler (butlerblog):

Recent Posts

  • Check and delete orphaned user meta in WordPress
  • Add a Database Connection to use WPDB
  • Notice: Function WP_Block_Patterns_Registry::register was called incorrectly
  • Use WP-CLI to back up your site
  • Bitnami WordPress Autoptimize cannot write to the cache directory

Copyright © 2026 · Maker Pro on Genesis Framework · WordPress · Log in