Your cart is currently empty!
WooCommerce code snippets

Share this:
Extend WooCommerce with the simple yet powerful custom functions that paste right into the Code Snippets plugin administrative interface.
- Account dashboard User Switching return button
- Add a WordPress user role
- Add billing fields to user registration
- Add capabilities to a WordPress user role
- Add column to admin posts table
- Add custom field to Product editor General tab
- Add custom image sizes into Block Editor
- Add descriptions to specific shipping methods
- Add featured images to single blog posts
- Add fee to carts by product category
- Add field to My Account address forms
- Add or change columns on digital download tables
- Add post editor metabox to a post type
- Add product attribute to CSS classes
- Add product thumbnails to Woo emails
- Add reusable blocks link to Appearance menu
- Add Shop page to Woo breadcrumbs
- Add-to-cart redirection to cart or checkout
- Admin display order line items
- Admin edit or customer cancel Processing status
- Admin menu bar add users link
- Admin notice of HPOS legacy cleanup progress
- Admin order item manual restocking
- Admin orders list custom field HPOS compatible
- Admin page metaboxes
- Admin set all products to a global attribute
- Admin users custom column sortable
- Admin Users panel custom searchable column
- Allow unauthenticated pay-order
- Always show in-stock message and customize it
- Append variation attributes to order summary
- Auto apply a coupon code based on user role
- Auto select variation attribute by user role
- Automatically trash expired coupons daily
- Block Editor social icons add hover titles
- Boot WooCommerce session for guests
- Brand attribute on product short descriptions
- Bulk delete users by role
- Bulk regenerate download permissions
- Bulk update product categories
- Bulk variable subscription pricing
- Calendly modal on all hyperlinks with a class
- Cart and Checkout order bump up-sell
- Cart or Checkout too heavy notifications
- Change archive and Query Loops thumbnail size
- Change the Related Products heading level
- Check & COD to Pending status with redirect
- Checkout Block custom validation
- Checkout Block Order Note field customization
- Checkout credit card expiration date formatter
- Checkout custom fields – Classic checkout
- Checkout custom terms/conditions modal
- Checkout restrict products and countries
- Clear all menu_order values from products
- Cloudflare Turnstile contact forms
- Custom order number display for imported orders
- Custom order status
- Custom Storefront site header
- Customer registration notification emails
- Customize added-to-cart and coupon messages
- Customize My Account dashboard welcome message
- Customize WordPress login page logo
- Debug pending software updates
- Delete customers without orders
- Detect an reactivate an inactive plugin
- Disable all price displays
- Disable Amazon Pay on free checkouts
- Disable and log all outbound emails
- Disable comments on media attachments
- Disable Elementor Google fonts and load manually
- Disable free shipping by product category
- Disable guest checkout for digital downloads
- Disable password change notification to admin
- Disable password reset emails
- Disable payment gateways upon Elementor editing
- Disable plugin & theme update admin notification
- Disable purchasing for unauthenticated visitors
- Disable related products
- Disable shipping on cart page
- Disable unique SKU check
- Disable Woo Coming Soon mode when User Switching
- Disable WooCommerce sale badges
- Disable WooCommerce Status dashboard widget
- Disable XML-RPC for security
- Discount orders based on payment method
- Display all hooks on a page
- Display category image on category archive page
- Display cross-sells on the product pages
- Display product gallery thumbnails in archives
- Display shipping class on cart item names
- Download a MailChimp contact list to CSV
- Downloadable products enable EXE and PKG
- Economize Woo orders admin search fields
- Efficiently load Google Fonts
- Elementor archive title translations
- Elementor Form Submissions for Shop Managers
- Elementor Pro custom query from ACF field
- Elementor Pro Form processor
- Eliminate a payment gateway on cart conditions
- Empty cart when adding
- Enable a capability for a user role
- Enable authors for products
- Enable automatic updates
- Enable block editor for products
- Enable revisions storage for products
- Enable user capability for a REST API request
- Enforce min and max quantities for a product
- Enqueue Elementor icons on Elementor Forms pages
- Exclude visibility hidden products from search
- Export bulk orders to CSV spreadsheet
- Find and trash specific orders
- FlexSlider slider gallery HTML elements
- Fractional quantity by product category
- Free shipping calculator for cart and checkout
- Front end password wall
- Function to copy a WooCommerce order
- Genesis theme custom search results template
- Google Ads tracking and conversion
- Google reviews WordPress short-code
- Gutenberg editing full width
- Heading block merge tags
- Hide added to cart message
- Hide coupon banner and form on checkout page
- Hide other rates when free shipping is available
- Hide pricing except for authenticated users
- Hide the default category on the Shop page
- Hide variable product price ranges
- Import a comment
- Import CSV to blog posts
- Import WordPress users from CSV text
- Increase the variations threshold
- JavaScript counter animation
- JetPack infinite scroll with footer widgets
- Jetpack Tiled Gallery block image links
- JudgeMe product review sync to WooCommerce
- Klaviyo send a custom event
- Klaviyo signup form wp_mail notification
- Konnektive CRM lead import
- Limit gateway options based on cart item SKU
- Limit the number of cross-sells on cart page
- Load Font Awesome icons
- Load Google Analytics
- Load SyntaxHighlighter for WP Code blocks
- Maintenance mode for store only
- Maintenance mode site-wide
- Make Elementor columns clickable to a button
- Make site header sticky on scroll
- Make the company name field read-only
- Microsoft Ads UET revenue variable
- Modify back-order text
- Modify cart items sort order
- Modify order received thank you message
- Modify variations price ranges to Starting-at
- Modify WooCommerce Products block output
- Modify WP Block Latest Posts output
- Move a custom field to featured image for blog
- Move checkout input labels to placeholders
- Move classic checkout email and phone fields up
- Move full description above short description
- Move the WooCommerce Store Notice up top
- Move up-sell and related products above tabs
- Move up-sells under cart order totals
- Multiple add-to-cart in a single request
- My account add a custom link
- Navigation sticky and latest posts
- Notify site admin of My Account address save
- Notify site admin of My Account profile save
- Order action: view and print receipt
- Order Again button on My Account Orders
- Order search include Order Number field
- Order tracking information on completed email
- Order tracking information on note emails
- Out of stock display up-sells
- Pause Action Scheduler
- PIP invoices show recurring totals
- Place a Gutenberg JetPack contact form anywhere
- Place ACF product gallery onto single products
- Place Elementor templates with shortcode
- Prevent duplicate posts across featured blocks
- Prevent post office box deliveries
- Previously purchased cart & checkout warning
- Printer friendly product page links
- Prioritize products in search results
- Private pages redirect to my-account login
- Product bundles stop stock notifications
- Product image hover flipper
- Product search include categories and tags
- Product search: include SKU matching
- Products shortcode custom ordering
- QualPay Checkout payment gateway
- Query Loop customization
- Quote Request logic
- Re-route unauthenticated front-end traffic
- Re-title Checkout page on free orders
- Redirect non-admin front-end traffic 301
- Redirect product variation SKU URLs to parent
- Regenerate thumbnails for specific images
- Register a classic sidebar widget
- Register custom post types
- Register Customizer for block themes
- Remove a shipping method when free tier
- Remove action scheduler job
- Remove add-to-cart buttons, view only mode
- Remove additional information product tab
- Remove Blocks CSS assets
- Remove can-be-backordered label
- Remove cancel buttons from My Account Orders
- Remove connect to WooCommerce.com notice
- Remove coupon form in cart
- Remove headings description and additional info
- Remove item from cart on trigger product add
- Remove items from My Account menu
- Remove order notes / additional information
- Remove price from Woo product schema
- Remove prices from archive pages
- Remove product archive sort criteria
- Remove product archives sorting
- Remove product links from order table
- Remove shipping methods based on product class
- Remove single product metadata
- Remove site logo
- Remove stock changes by order status change
- Remove Storefront blog sidebar
- Remove Storefront breadcrumbs
- Remove Storefront home page title
- Remove Storefront styles
- Remove Storefront theme blog post meta fields
- Remove Storefront theme footer message
- Remove Storefront theme handheld navigation bar
- Remove Storefront theme header cart
- Remove Storefront theme header product search
- Remove tabs from product pages
- Remove Woo email table borders
- Remove WordPress emojis for performance
- Rename cart to bag
- Rename checkout fields: order notes
- Rename order statuses
- Rename related products heading
- Rename up-sell title and column layout
- Replace coupon form with a pop-up link
- Replace coupon form with URL argument
- Replace new user email with Woo New Account
- Replace Storefront product search with text
- Replace WooCommerce single product gallery
- Report number of line items per order
- Report products missing meta data
- Return-shop and Continue-shopping links
- Reusable Block for Google Form modal
- Review stars show no ratings placeholder
- Routinely disable product.updated web hooks
- Run manual database query
- Search Block query customization
- Search widgets filter to posts only
- Select Klaviyo subscribe checkbox in checkout
- Selectively disable lazy loading images
- Separate plus and minus quantity buttons
- Set user role on payment of a product
- Share-this feature for Social Links Blocks
- Short code to accept JetPack sign-ups
- Shortcode for Ontraport newsletter signup form
- Shortcode for product attribute description
- Shortcode to display a text widget body
- Shortcode to display any ACF field
- Shortcode to show recently purchased products
- Shortcode to use a classic widget within blocks
- Show captions on featured images
- Show list of categories on product archives
- Show order histories on admin user profiles
- Show review count next to star ratings
- Show variation forms in product archives
- Show/hide search using an icon
- Single products with no price contact button
- Site search include all postmeta
- Skip images from WordPress SRCSET
- Slack notifications
- Sort comments by name
- Sort My Downloads alphabetically
- Sort shipping methods by price
- Staging environment banners
- Stop user enumerations for PCI scanners
- Storefront custom footer links
- Storefront product page gallery features
- Storefront show blog excerpt on archives
- Storefront theme 404 page customizations
- Storefront theme search results custom template
- Subscriptions do not reduce stock on renewal
- Swap a block cover image conditionally
- Temporarily disable deprecated notices
- Test sending an email
- Transactional email for custom order status
- Trash all products
- User profile field trigger Woo New Account email
- User profile: add custom fields
- User registrations to JetPack
- Variable product buttons change Select Options
- Variable product options on archives
- Variation sale you-save price calculation
- Variations radio buttons with swatches
- Woo From Name and Email on WP notifications
- WooCommerce cart menu item
- WooCommerce order admin meta box HPOS compatible
- WooCommerce PIP add description to line items
- WordPress load Google Tag Manager
- WordPress REST API webhook listener
- WordPress sitemap customization
- WP CLI add a custom command
- WP Mail PhpMailer SMTP router
- X-Frame-Options for PCI compliance scanners
- Zendesk contact form and integration
Credits
We code all of our code snippets directly. Our clients provide most of the ideas and demand for the functionality provided by our code snippets.
There are several sources one can find on Google for code that has inspired or contributed to this open-source library. Here’s some main ones: