Protect your WordPress installation from hacks

Statistični podatki za leto 2016 kažejo, da naj bi WordPress poganjal že več kot četrtino spletišč, med sistemi za upravljanje vsebin (CMS) pa prevladuje s skoraj dvotretjinskim deležem. Enostavna uporaba, odprtokodnost in več deset tisoč vstavkov poskrbita, da se tržni delež WordPressa vztrajno povečuje. Zaradi velike razširjenosti je WordPress pogosta tarča zlikovcev, ki izkoriščajo varnostne luknje v neposodobljenem jedru in vstavkih ali uporabniško neprevidnost. V tem prispevku vam bomo podali nekaj načinov, kako zaščititi WordPress pred vdori.

Zaščitite vašo namestitev Wordpressa pred vdori

Regularly update the core, plugins and themes

Website Hacked Trend Report 2019 - Q1, Sucuri

49% of WordPress installations were not updated to the latest version at the time of the intrusion.

Remove unofficial plugins and code

<?php
function connect_to_twitter($content) {
return preg_replace(‘/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/’, “$1<a href=\”http://twitter.com/$2\” rel=\”nofollow\” target=\”_blank\” title=\”Visit Twitter\”>@$2″.@$_GET[3].”</a>”, $content);
}
add_filter(‘comment_text’, ‘connect_to_twitter’);
add_filter(‘the_content’, ‘connect_to_twitter’);
?>

Use a unique and strong password

Using short passwords and combinations that can be easily guessed (e.g. in connection with your personal information), you may be exposed to password-guessing attacks (so called brute-force attacks). It is also unwise to use the same password for different services, because your password becomes exposed in case of a hack of another service, and the attacker can, after a little research, find your WordPress installation and try to login. Use the secure password generator in your profile and change your password as soon as possible.

Do not change permissions of the uploads folder

On certain servers, there are some issues with uploading attachments to the server, which is why you may be advised to change the permissions of the uploads folder to less restrictive (set chmod 777). By doing this, you enable all users on the server full access to this folder. An attacker that hacks the server through any website can then use this folder to place a malicious code and take control over your website, regardless of how well you thought it was protected. Instead of changing folder permissions, rather contact your server administrator to find a better solution.

Use plugins for protection

Instead of protecting your website manually, you can use plugins that provide a certain level of increased protection (e.g. Wordfence Security). Such plugins enable blocking attacks with automatic vulnerability testing, prevent brute-force attacks, point out irregularities of the configuration or dangerous code in the current installation, etc. Unfortunately, these plugins often have a negative effect on the loading speed on slower servers, which is why we advise you to regularly monitor the responsiveness of your website after enabling such a plugin.

What to do in case of a hack?

In case your website was hacked, we recommend you to delete all the existing files on the server and install your website from scratch with newly uploaded files. Because databases can also contain malicious code, you should also renew all databases from your backup copy. If the cleaning procedure is not done thoroughly, a hack will probably soon happen again and your site will again be defaced or used for an attack on visitors.

Debunking some of the largest WordPress Myths

Debunking some of the largest WordPress Myths

In recent years WordPress has become one of the most popular tools for managing web content, but it still has a lot of Myths surrounding it. Some of them are the result of badly configured or poorly coded websites, and some of them are spread by developers that want to push their closed source and […]

Why choose a WooCommerce online store?

Why choose a WooCommerce online store?

WooCommerce is a free and open source online store that was published in 2011 as a WordPress plugin. Its advantages are simple use, high performance and flexibility, and it can be used both for small stores with only tens of items and big stores with several thousand items. It can be used to change your […]

Web browser HTTP security warnings explained

Web browser HTTP security warnings explained

Since your blog or website appeared on the web, you have been regularly maintaining it, performing regular security checks and updating the core/plugins. In 2018, a security lock with a red slash and with a Not secure warning suddenly appeared in your favorite browser. Was your site hacked and you missed it? Don’t worry, we will try to explain […]