Code Snippets

Copy-paste solutions to save time (and sanity) in your projects.

If you’ve ever wanted a quick code fix, a clever trick, or a better way to solve a recurring dev problem—you’re in the right place. These are small, reusable bits of code and insight that I use myself (and share with you) to speed up dev work and avoid reinventing the wheel. If any of this code helped you, or you have any questions on implementation, please don’t hesitate to reach out.

Add SoftwareSourceCode Schema to Yoast SEO

Code Schema Snippet visual representation
Adds SoftwareSourceCode schema to Snippet posts, automatically including the code, language, and keywords for improved SEO and search visibility.

Preload First Image on Front Page

Lowest Contentful Paint Results Scrrenshot
Boost your site speed by preloading the first homepage image, ensuring faster hero loading and improved Core Web Vitals performance.

Site Notes for WordPress Multisite

Site Notes edit page screenshot
This snippet enhances the WordPress Multisite network by introducing a dedicated notes column in the Sites table within the Network Admin dashboard.

Random WordPress Post of the Day

Post of the Day visualization
Increase user engagement by showcasing a unique post each day on your WordPress site. This PHP snippet ensures that visitors see a different post daily, refreshing at midnight.

SKU Search for WordPress Multisite

SKU Search screenshot
This snippet for WordPress Multisite adds custom search functionality that allows administrators to search for products by their SKU across the entire network.

Click Saver for WordPress Multisite

Click Saver screenshot
This snippet makes direct links to admin pages for sites in your network. It is great for doing repetitive tasks (such as downloading WooCommerce reports).

Recent WooCommerce Orders in WordPress Multisite Network List

Recent Orders screenshot
This code enhances the WordPress Multisite Network Admin dashboard by adding a new column to the Sites table that shows the date of the most recent WooCommerce order.

Add Custom Social Profiles to WordPress & Yoast SEO

Social Profiles and Yoast SEO visual representation
Code snippet that adds custom social fields (IMDB, GitHub, WordPress, etc.) to user profiles and include them in Yoast SEO schema output.