WooCommerce: Should I use WP Editor, FTP or “Code Snippets” to Customize PHP?

There are many ways to customize functionalities (via PHP) on your WordPress/WooCommerce website – and many developers totally underestimate the pros and cons of each different method. So, today I want to remind you what is the ONLY way you should be customizing WordPress from now on.

Before we pick a customization method…

There is no doubt if you’re about to customize a WordPress website, and even more importantly a WooCommerce website, you need a child theme.

Building a child theme can take about 10 minutes – you only need to create 2 files with a few lines of CSS (style.css) and PHP (functions.php).

Here’s a quick and free video lesson for you: “Where to Place WooCommerce Customization?

PHP Customization Method 1: WP Editor

WordPress contains a built-in editor that allow you to edit theme files directly from your browser. You can access the WP Editor from the WP Dashboard > Administration > Appearance > Editor.

Even if you have a child theme, using the WP Editor for PHP customization is not a good idea. In fact, the changes you make to the functions.php file are instant. You and any visitors to your site will see the changes immediately – including if you forget a simple comma and break the website (Error 500) without the chance to restore the previous version or click on the “Back” button on your browser.

Never, ever, use the WP Editor for PHP customization. If you break the website you will need access to your FTP so that you can correct the issue… so let’s move on to method 2!

PHP Customization Method 2: FTP

FTP is the best way to customize your WordPress/WooCommerce website.

You can open the files in your favorite text editor (I use Notepad++), do the edits there, save a backup and if you break something you can immediately correct / rename / comment out the PHP function.

Whenever you do work on live websites (like I do), always make sure to ask for the WP login/password as well as the FTP credentials. And remind the client you will not start working until you get the FTP details and test they work!

PHP Customization Method 3: “Code Snippets” Plugin

Code Snippets plugin is super handy when you don’t have a child theme (why would you not have a child theme though?) or when you want to test / run just a couple of PHP snippets.

It’s interface is awesome and easy to use, including the enabling/disabling snippets and your website will not go down if you forget a comma… the plugin will simply tell you what the problem is and disable the snippet without giving Error 500.

The problem is that you won’t be able to find the snippets via FTP or File Manager, as the plugin stores them somewhere in the database. If your website goes down for other problems (a plugin conflict for example), it’s super difficult to disable a code snippet from outside of WordPress.

 

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

4 thoughts on “WooCommerce: Should I use WP Editor, FTP or “Code Snippets” to Customize PHP?

  1. Hi Rodolfo – if you would like to use the codes snippets plugin & it still breaks your site, you can always add this snippet to ‘wp-config.php’.

    define('CODE_SNIPPETS_SAFE_MODE', true);

    This activates the plugin’s safe mode, enabling you to change/remove the snippet that broke the site instantly.

    1. Awesome!

  2. Most useful Information for those who do php edits frequently !

    1. Thank you!

Questions? Feedback? Support? Leave your Comment Now!
_____

If you are writing code, please wrap it between shortcodes: [php]code_here[/php]. Failure to complying with this (as well as going off topic, not writing in English, etc.) will result in comment deletion. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining BloomerArmada to get blog comment reply priority, ask me 1-to-1 WooCommerce questions and enjoy many more perks. Thank you :)

Your email address will not be published. Required fields are marked *