Welcome to the second installment of the WordPress Rockstar series, where we will take you…
How to Edit WordPress Safely
Not too long ago, someone emailed me for some advice on how to fix their website. They had been editing Thesis with the built in custom file editor. After saving a change they made, the website would not work anymore and was spitting out errors. The gentleman told me that he had talked to some freelancers that had bid as high as $400 to fix the website.
I ended up helping the gentleman fix his error and get his website running again. The lesson here? Programming isn’t easy, and if you’re not careful you can easily make an expensive error. But, there are ways that you can protect yourself in case you make a mistake while editing your WordPress.
I’ll be the first to admit that when I started working with WordPress I would do what I have heard called “cowboy editing”. This is where you use the built in editor for WordPress to edit your themes. The problem with this is that if you make an error, it can bring your site down, and then there is no simple “undo” available. When you use a text editor, you can easily make edits while still giving yourself the ability to “undo” any mistakes you make.
Combine a Text Editor With an FTP Program
Now, there are two ways that you can use a text editor to make edits to your website. Some text editors have built in FTP functionality, which makes this a little bit easier. But, you can also get the same functionality if your FTP program has edit capability. Let’s describe the FTP program editing first.
I will describe how to do this using Filezilla since this is an open-source project that can be used on both PCs and Macs. In Filezilla, you:
- Connect to your server.
- Navigate to the directory of the file you want to edit is in.
- Right-click the file and select view/edit.
- Edit the file in your text editor.
- Save the file in the text editor.
- Switch back to Filezilla and approve the upload.
Use a Text Editor With Built-in FTP
That’s not that bad is it? But, there is an even easier way to edit your files. Use a text editor that has built in FTP capability. Now, I use Mac, and I am only comfortable giving suggestions for software that I have used. For that reason, the next two programs I recommend are going to be for Mac. There are suitable solutions for PC also, but I will allow others to recommend their favorite text editors in the comments.
With that said, I recommend two programs for Mac – Espresso and TextWrangler.
TextWrangler is a free, basic text editor that is available in the Mac App Store. This program is is simple, but has some powerful features, including:
- Multiple undos
- State save if you accidentally quit the program
- Periodic auto-save
- FTP and SFTP support
- Open multiple documents in a window
- and more
As you can see, TextWrangler is a pretty powerful text editor, especially for being free! But, I personally use another program on my Mac.
When I am doing web development, I use Espresso from Macrabbit. Espresso has many of the same features of TextWrangler, but I like the extra features it has, such as:
- CSSEdit3. This is tool that will help you create CSS for your website.
- Code sense and code folding. Code quicker and manage your code.
- Sync capability. Upload a file as soon as you save.
- Live styling. See updates in real time
- and more
Using either one of these editors, you can easily make an edit and upload it to your server. If your change breaks your website, simply undo and re-upload. If you combine this with only making small edits at a time, you will be able to pinpoint exactly where your bad code is. Sound nice, eh?
After reading this article, I hope that you now think that editing your article in a text editor is simple! Using a text editor, instead of the built in WordPress editors, will save you frustration and headaches when you inevitably make a coding mistake.
Have questions or input? Leave a comment below!