QuickOnlineTips Newsletter |
How to Beef Up Your WordPress Security Posted: 10 Mar 2011 09:38 AM PST Guest post written by Thomas Frank. How can you increase your WordPress security. WordPress is a popular blog platform that has, in recent months, transformed into a great content management system. As with any good CMS, WordPress has some security features built into its core. However, the default installation is still vulnerable to certain attacks. Fortunately, there are several easy steps you can take to harden WordPress against these attacks. Common WordPress AttacksHere is a listing of the most common types of WordPress attacks:
Fortunately, protecting WordPress against these attacks isn’t terribly difficult. Here is a listing of things you should do: Keep WordPress and related files updatedKeep your WordPress installations updated to the latest version. As of right now (3/1/2011), the latest version is 3.1. 3.2 is set to release sometime this year. Make sure to update plugins as well. As noted above, out-of-date plugins can pose security risks. If you have a bunch of plugins that are deactivated or unused, it’s best to delete them. Each plugin you have can pose a security risk if there is a flaw in it. If you have a plugin you plan on using later, store it outside of your WordPress installation until you need it. Create security through obscurityThis security concept is based around the fact that most automated attacks will target default WordPress parameters. Therefore, make sure your installation doesn’t have these default parameters. Delete the user ’admin’. Brute force attacks will almost ALWAYS try to login with this username.
// Note that you should replace 'prefix' with your table prefix and 'newusername' with your desired admin username. update table prefix_users set user_login='newusername' where user_login='admin'; Do not use the “wp_” table prefix for the tables in your MySQL database.
Rename table wp_comments to wangchung_comments;
/** * WordPress Database Table prefix. * * You can have multiple installations in one database if you give each a unique * prefix. Only numbers, letters, and underscores please! */ = 'wangchung_'; You may notice that doing this locks you out of you Administrator account. No worries! There’s just a couple more commands to issue at the MySQL command prompt: UPDATE newPrefix_options SET option_name = REPLACE (option_name, 'oldPrefix_', 'newPrefix_'); UPDATE newPreifix_usermeta SET meta_key = REPLACE(meta_key, 'oldPrefix_', 'newPrefix_'); Blocking access to unneeded informationWordPress can give away too much information. Here’s a couple ways to prevent it from doing that: Prevent WordPress from giving specific error messages upon unsuccessful login attempts.
// code to hide feedback upon unsuccessful logins add_filter('login_errors',create_function('', "return 'Please try again.';")); Move wp-config.php up one directoryMoving this file out of your public folder makes it less accessible. WordPress is built to check for this file one directory up if it can’t find it in the default location. Prevent malicious modification of the GlOBALS and $_REQUEST variablesMany attacks will attempt to inject malicious scripts into your database. Prevent this by adding the following code to your .htaccess file: Options +FollowSymLinks RewriteEngine On RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR] RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR] RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2}) RewriteRule ^(.*)$ index.php [F,L] Back up, back up, back upRegularly back up both your WordPress files and your database. The more you post content to your site, the more you should back up. This is not only to protect you from the bad guys, but also from yourself when you try new things
Essential security plugins
You can never be too careful these days when it comes to security. Luckily, these precautions will keep all but the most determined hackers out of your site. Happy blogging! Guest author Thomas Frank is the founder of College Info Geek, a college success blog with a heavy focus on technology. He is a sophomore at Iowa State University studying management information systems and speech communication. Connect with him on Twitter. Licensed image courtesy of Flickr user Max Klingensmith. |
You are subscribed to email updates from Quick Online Tips To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
0 comments:
Post a Comment