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.
- Accept multiple product quantity add-to-cart in single request
- Add a user switching return button into My Account dashboard
- 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 with matching product categories
- 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 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 add custom column and include in search
- Allow unauthenticated pay-order
- Always show in-stock message and customize it
- Append variation attributes onto order’s product titles and emails
- Auto apply a coupon code based on user role
- Automatically trash expired coupons daily
- Block Editor social icons open in new tab and add hover titles
- Boot WooCommerce session for guests
- 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 page move up-sells under order totals section
- Change the Related Products heading level
- Change thumbnail size for archives and Query Loop blocks
- 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 specific products and countries
- Cheque & COD orders to Pending status with Pay Now redirect
- 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 My Account dashboard welcome message
- Customize the added-to-cart and added-coupon messages
- Customize WordPress login page logo
- Debug pending software updates
- Delete customers without orders
- Detect an reactivate an inactive plugin
- Disable admin notification of user password change
- 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 download products on cart
- Disable password reset emails
- Disable payment gateways upon Elementor editing
- Disable plugin and theme update admin notification emails
- Disable related products
- Disable shipping on cart page
- Disable Storefront theme product page gallery features
- Disable Woo Coming Soon mode when User Switching
- Disable WooCommerce Status dashboard widget
- Disable XML-RPC for security
- Display all hooks on a page
- Display category image on category archive page
- Display cross-sells on the product pages
- Display product gallery and variation thumbnails in archives
- Display shipping class on cart item names
- Download a MailChimp contact list to CSV
- Economize Woo orders admin search fields
- Efficiently load Google Fonts
- Elementor archive title translations
- Elementor Pro custom query for product blog posts from ACF relationship 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 Elementor Form Submissions for Shop Managers
- Enable EXE and PKG files for WooCommerce digital downloads
- Enable revisions storage for products
- Enable user capability on a specific REST API request
- Enqueue Elementor icons font on pages containing Elementor Forms
- Exclude catalog visibility hidden products from WP site search
- Export bulk selected orders to CSV spreadsheet file
- Find and trash specific orders
- FlexSlider slider gallery HTML elements
- Force minimum and maximum quantities for a product
- Fractional quantities or custom quantities 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 Uncategorized on the Shop page
- Hide variable product price ranges
- Hook transactional email into custom order status
- Import a comment
- Import CSV to blog posts
- Import WordPress users from CSV text
- Increase the variations threshold
- JavaScript counter animation
- JetPack: Enable infinite scroll with footer widgets
- JudgeMe product review sync to WooCommerce
- Klaviyo send a custom event
- Klaviyo signup form email notification using wp_mail
- Klaviyo subscribe checkbox on WooCommerce Checkout Block
- 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 buttons within
- Make site header sticky on scroll
- Make the company name field read-only
- Microsoft Ads UET revenue variable for Woo checkout
- Modify back-order text
- Modify cart items sort order
- Modify order received thank you message
- Modify the return-shop and continue-shopping links
- Modify variation drop-downs to radio buttons
- Modify variations price range to a Starting-at price
- 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 email address and phone fields up in checkout
- Move full description above short description
- Move the WooCommerce Store Notice to the top of pages
- Move up-sell and related products above tabs
- My account add a custom link
- Navigation menu add sticky and latest posts as menu items
- Notify site admin of My Account address save
- Notify site admin of My Account profile save
- Order action: view and print receipt
- Order search include Order Number field
- Out of stock display up-sells
- Pause Action Scheduler
- Place a Gutenberg JetPack contact form anywhere
- Place ACF product gallery onto single products
- Place Elementor templates with shortcode
- Place order tracking information onto customer note emails
- Place order tracking information onto order completed emails
- Place the Order Again button onto My Account Orders page
- Prevent duplicate posts across featured blocks
- Prevent post office box deliveries
- Previously purchased item cart and checkout warning
- Printer friendly product page links
- Prioritize products in search results
- Private pages redirect to my-account login
- Processing status: enable admin editing and customer cancelling
- Product archives show variable product variations forms in loop
- Product archives: Simple products separate plus and minus quantity buttons
- 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 action scheduler job
- Remove add-to-cart buttons, view only mode
- Remove additional information product tab
- Remove can-be-backordered label
- Remove cancel buttons from My Account Orders
- Remove connect to WooCommerce.com notice
- Remove coupon form in cart
- Remove CSS assets from Gutenberg Blocks & WooCommerce Blocks
- Remove description and additional information headings
- Remove items from My Account menu
- Remove order notes / additional information field
- 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 specified products from cart when a trigger product is added
- Remove specified shipping method(s) during free tier
- 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 basic new user email with Woo New Account email
- Replace coupon form with a pop-up link
- Replace coupon form with URL argument
- Replace Storefront’s product search with phone number
- Replace WooCommerce single product gallery
- Report number of line items per order
- Report products missing meta data
- Reusable Block for Google Form modal
- Review stars show no ratings placeholder
- Routinely disable product.updated web hooks
- Run manual database query
- Search widgets filter to posts only
- Selectively disable lazy loading images
- Set Member user role upon order payment of membership product
- Set `X-Frame-Options` header for PCI compliance scanners
- Share-this feature for Social Links Blocks
- Short code to accept JetPack sign-ups
- Shortcode for Ontraport newsletter signup form
- Shortcode to display a product attribute value description
- Shortcode to display a WordPress text widget body
- Shortcode to display any ACF field
- Shortcode to show recently purchased products
- Shortcode to use a classic widget within blocks
- Show brand attribute on single product short descriptions
- 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 variable product options on product archives
- Single product with no price place email us button
- Site search include all postmeta
- Sitewide or product search show/hide using an icon
- Skip images from WordPress SRCSET
- Slack notifications
- Sort comments by name
- Sort My Downloads alphabetically
- Sort shipping methods by price
- Staging environment banners
- Stop OOS notification emails on product bundle parents
- Stop user enumerations for PCI scanner compliance
- Storefront custom footer links
- Storefront show blog excerpt on archives
- Storefront theme 404 page customizations
- Storefront theme search results custom template
- Subscriptions show recurring totals on PIP invoices
- Swap a block cover image conditionally
- Temporarily disable deprecated notices
- Test sending an email
- Trash all products
- Use WooCommerce From Name and Email for WordPress notifications
- User profile field to trigger Woo New Account email
- User profile: add custom fields
- User registrations to JetPack
- Variable products change button to add-to-cart in shop loops
- Variation sale pricing append you-save calculation
- WooCommerce cart menu item
- WooCommerce order admin meta box HPOS compatible
- WooCommerce Print Invoices & Packing Lists add description to line items
- WooCommerce Subscriptions do not reduce stock on renewal orders
- WordPress load Google Tag Manager
- WordPress REST API webhook listener
- WordPress sitemap customization
- WP CLI add a custom command
- WP Mail PhpMailer SMTP router
- 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: