Editing WordPress files, don’t jeopardize your blog’s security

I know a lot of people who blog with WordPress tend to edit their files right in their WordPress dashboard. If you go under “Appearance” in your WordPress dashboard and click on “Editor”, you’ll have a list of files you can edit. However, you need an FTP program to change permissions to these files so they become editable. Otherwise, you have this message at the bottom of your page:

not-writable

If you have a self-hosted WordPress blog, chances are you already have an FTP program. Chances are you’ve also had to change permission settings for your files too, but just in case you haven’t, here’s a short explanation.

After you’ve logged into your FTP program, navigate to the file you want to edit. Your theme files will be in wp-content > themes > theme folder. If I wanted to make my footer.php file editable, I just right-click on it, select properties,

editing-files

and change the “Value” to “777″.

permissions

Any other time, those files should always be set to “644″. Folders are always “755″. This prevents anyone from changing those files – and that would be a bad thing!

NOW, before you go and do that – I have a better way of editing files. I don’t EVER use the theme editor in WordPress. I just log into my FTP program, locate the file I want to change, right-click, and select “Edit”.

edit

I always use Notepad to edit text files, but if you don’t, your file will open up in whatever your default program is set to.

Once the file is open, I change what I need to, select File > Save, then close it. In my particular FTP program, it will ask me if I want to overwrite the file or not. I select “Yes” and continue on my merry way. Just to be sure, you’ll want to refresh your blog’s page in your browser to make sure whatever changes you made are correct.

Why should you do it this way and not through WordPress?

It’s less work for one thing. More importantly, there’s no chance that you might forget to change the permissions of your file back to “644″ which would leave your blog much more vulnerable to hackers. There’s also no chance of screwing up the permissions of your files so bad that you break your blog.

I remember when a dear friend (we’ll call her Stacy since I don’t want her to be mad at me for using her real name in case she’s reading!) changed the permissions of her files to update her files and ended up screwing things up so bad that her blog disappeared. We both had a few heart attacks until I figured out what had happened, but I explained to her that editing files directly through her FTP program would ensure that that didn’t happen again.

I’m a total geek but I’m no Einstein so there could be a much easier and more efficient way of doing things. However, I do know that my way of editing WordPress files is much safer than editing directly through the WordPress theme editor.

Related reading:

RT @cassiegermsheid: "Editing WordPress files, don’t jeopardize your blog’s security"

2 comments ↓

#1 Arika on 03.06.09 at 8:22 am

Thanks so much for this. I actually did the same thing your friend did at one point with my blog. Tried adjusting some things with the theme and BAM! it was gone baby gone.

Arika’s last blog post..If Only Everyone Felt This Way About the World

#2 Cassie on 03.06.09 at 8:41 am

Yeah it’s pretty easy to do. I actually have a local server set up so I can make changes and view them to make sure everything works before I actually transfer the changes to my theme. A little bit more work, but a lot more peace of mind!

Leave a Comment

CommentLuv badge