Where to Put Custom Code for Your Website in WordPress

Whenever you need to add custom code to your WordPress site, the typical recommendation is to put it in the theme’s functions.php file. I don’t like doing that as it’s easy to forget to copy-paste that code to the new theme when it’s time to a refresh.

Moreover, if done in that manner, you don’t have the ability to switch on or off certain functions.

The solution for me has been the following plugins:

Pluginception – Lets you create plugins from within the WordPress dashboard. This is useful when I just want to create one plugin to dump all the custom functionality into and have it protected whenever I change themes.

Code Snippets – An excellent plugin that lets you create snippets of code as functions that can be switched on or off at will, in the same way as you would with normal plugins.

Do you like these solutions?

About Jean Galea

Jean Galea is a WordPress developer, entrepreneur and padel player. He is the founder of WP Mayor, the plugins WP RSS Aggregator and EDD Bookings, as well as the Mastermind.fm podcast. His personal blog can be found at jeangalea.com.

Related Articles

4 Responses

  1. Anton
    Anton January 1, 2020 at 13:13 | | Reply

    Aboud Code Snippets, is it lightweight enough? I don’t like to add plugins basically…

  2. Romas Somar
    Romas Somar January 2, 2020 at 15:41 | | Reply

    Really nice article.. but what aboud code snippets are those lightweight enough?

Leave a Reply