• 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

Get an array of variation IDs for a WooCommerce product

WordPress Development Tips · December 22, 2021

If you need variation IDs for a WooCommerce product and you know the WC product ID, you can use one of the two following code snippets to …

Continue Reading

Check and delete orphaned post meta in WordPress

WordPress Development Tips · July 8, 2021

Through the natural course of managing a WordPress site and its database, you may end up with some orphaned post meta. This is especially …

Continue Reading

Block an IP address from accessing your site

WordPress Development Tips · June 19, 2020

Generally, you can use your .htaccess file to block access to your site from certain IP addresses. This can be an effective method of …

Continue Reading

Using WordPress Debug Constants

WordPress Development Tips · February 6, 2020

Here are some constants you can define in your wp-config.php file to assist with debugging. Note that debugging should not be enabled on …

Continue Reading

Save WordPress debug log by date

WordPress Development Tips · February 2, 2020

It's not recommended to keep debugging enabled on a production site. But sometimes you may need to in order to gain the data you …

Continue Reading

Utility function for the WordPress error log

WordPress Development Tips · December 5, 2019

There is function for writing information to the WP error log file - error_log(). The problem is that the function doesn't handle arrays …

Continue Reading

How to Create a Site Specific Plugin

WordPress Development Tips · December 4, 2019

A common question I get when supporting WordPress users is "where to I put this custom code snippet." A frequent and simple answer to …

Continue Reading

Don’t Use do_shortcode()

WordPress Development Tips · December 3, 2019

The Internet abounds with examples of bad practices in WordPress development. Using do_shortcode() unnecessarily is one of the most …

Continue Reading

  • « Go to Previous Page
  • Page 1
  • Page 2

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

  • 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
  • Create and delete WordPress sites in XAMPP with a batch file

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