
WordPress code snippets for hooks, custom post types, the REST API, WP_Query, admin screens and more. Copy, paste and adapt.

Disable emojis in WordPress: remove the emoji script and styles on the front end and in wp-admin, plus the feed, email and TinyMCE emoji handling.

When a WordPress search finds exactly one post, page or product, send the visitor straight to it instead of a results page with one item.

Hide the WordPress admin bar on the front end for subscribers, customers or any role you list, or for everyone, without a fatal error.

This code allows you to blur the background when someone triggers a modal, it helps put focus on the modal and not the background. The blur strength can be adjusted as needed. Add this to the main style sheet.

Here’s a PHP snippet that you can use to return a custom link to a specific language for the current page using WPML. This will output the custom link for the specified language code and can be used on any page. Example 1: This will output a link that says “Switch to French” and links…

This php snippet will provide you with a more efficient way of organizing and keeping track of your blocks in Oxygen builder.

Limit WordPress search results to posts only, or to the post types you choose, without touching search forms that ask for a post type.

Replace the WordPress admin dashboard with a page you built in Gutenberg, Bricks, Oxygen or Elementor, shown full width next to the admin menu.

Send the WordPress New User Registration email to the site admin whenever a customer creates a WooCommerce account at My Account or checkout.

Move the WordPress admin menu from the left sidebar to a horizontal bar at the top with CSS only, with dropdown submenus and keyboard access.

This code will add additional categories into oxygen block library

Hide the title of any classic WordPress widget by starting it with an exclamation mark, and keep the title in the widget admin.

Show titles built from custom fields, taxonomy terms and the date in the WordPress admin post list, instead of (no title) rows.

Add CSS classes, including Tailwind classes, to the links of a WordPress wp_nav_menu() with one extra argument, without replacing existing classes.

Remove the inline CSS WordPress prints for single Gutenberg blocks, like wp-block-group-inline-css, and keep the rest of the block styles.

This is nice feature but in most of the cases you will not want to have it so the clients do not go off brand and mess up with styling. Also its loading on front end so it’s extra load.

Create ACF field group and assign it to posts. Create field label and name it color and choose field type Color picker. Assign color to each post Create a repeater in Oxygen builder Select first child of Repeater Add class to that element “data-color-bg” Go to advanced > attributes > Add attribute. First field needs…
3rd party plugins actions admin archive block-themes block editor Blocks block theme build capabilities core CSS Custom Post custom post types Developer development filters Front End full site editing gutenberg hook Image img load styles maintenance media mu-plugin Must Have npm Oxygen performance php plugins scripts organizer security SEO settings api single product theme.json Tips updates WooCommerce wordpress wp-cli WP Admin