Skip to content

Free WordPress functions

Useful code, minus the treasure hunt.

Practical functions for developers, site owners and anyone who would rather solve the problem than install another bloated plugin.

WooCommerce Intermediate
<?php

Set a WooCommerce minimum order value

Useful for: Wholesale, delivery and low-margin stores Prevents checkout when the cart subtotal is below £25. Change $minimum = 25; to the…

View function →
Gravity Forms Easy
<?php

Capture the current page URL in Gravity Forms

Useful for: Enquiry forms placed across multiple pages Populates a Gravity Forms field with the page URL where the form was submitted.…

View function →
Content Easy
<?php

Change the automatic excerpt length

Changes generated excerpts to 28 words and replaces the default ending with an ellipsis. Change 28 to the required number of words.…

View function →
Performance Easy
<?php

Disable WordPress emoji scripts

Removes WordPress’s additional emoji scripts and styles when native browser emoji support is sufficient.

View function →
User and Admin Easy
<?php

Redirect customers away from wp-admin

Redirects non-editor users from the WordPress dashboard to a front-end account page. Change /my-account/ when the website uses a different front-end dashboard…

View function →
User and Admin Easy
<?php

Hide the admin toolbar from customers

Hides the WordPress toolbar from users who cannot edit posts, while leaving it visible for administrators and editors.

View function →