Join

Code Snippet Solutions

  • Guides reflect how I’m currently using the solution for myself and my clients. 
  • If I don’t cover a specific feature, it implies I’m not using it.
  • If I don’t cover a specific setting, it implies the defaults are acceptable or the options are obvious.

Adding custom code to MyListing websites is a popular topic. This guide is an up-to-date journal of my approach to this topic, taking into account performance, ease of administration, features, etc.

What Not to Do

MyListing Custom Code Area

If you take nothing else away from this guide, know that you should NEVER ADD CUSTOM CODE TO THE MYLISTING CUSTOM CODE AREA (Theme Tools > Theme Options > Custom Code).

  • Regardless of its necessity, the code loads on every page, causing it to slow down significantly
  • You can easily break your website’s functionality and design, as there are no safeguards or warnings
  • You cannot easily reuse your code on other websites you manage
  • There are no autocomplete features to help you write (or learn to write) code

WordPress Customizer

This area only applies to CSS, but most of the points still hold true.

  • Regardless of its necessity, the code loads on every page, causing it to slow down significantly
  • You can easily break your website’s design, as there are no safeguards or warnings
  • There are no autocomplete features to help you write (or learn to write) code

Functions.php

This area only applies to PHP, but most of the points still hold true. I routinely see the MyListing developers suggesting that people should manually update their functions.php, but this is generally bad advice.

Suggesting to manually update this file is not only dangerous (especially to those with limited technical knowledge), but also the MyListing developers are opening themselves up to more support requests. It just doesn’t make sense, but here we are.

  • You can easily break your site, as there are no safeguards or warnings
  • There are no autocomplete features to help you write (or learn to write) code

Better Approach

This is the order in which I’d consider adding custom code to your MyListing website. The goal is to avoid all of the shortcomings outlined in the What Not To Do section.

  1. If you’re already using WPCodeBox, stick with it. It’s what I’m currently using and implementing on client websites.
  2. If you’re in need of a premium solution, here are some code snippet plugin deals.
  3. If you’re looking for a free solution, look at FluentSnippets. However, as I’ve mentioned to them, it’s difficult to trust this plugin long-term (very little ongoing development, no changelog, limited documentation, etc.). This is why I’m so adamant about not always going for free solutions—they don’t get the same attention as premium solutions.
  4. If you’re using Perfmatters, they have a new code snippet feature that’s in BETA. Keep an eye on this. Given that Perfmatters is focused on performance and how great the developers are behind the plugin, I could see myself moving all of my code snippets to it, especially since Perfmatters already goes on every website I manage.