Home » Blog » News » Ten Tips to Harden Your WordPress Site
In June, I attended WordCamp, Vienna, a huge conference that focuses on everything WordPress – not just an excuse for a holiday! It’s a fantastic conference for everyone from the casual WordPress user to core developers. I learned lots of new things, some of which I hope to share through our blog and on LinkedIn.
One of the first talks I went to was by the wonderful Maurizio Pelizzone, an Italian WordPress Developer who whizzed through ten tips in ten minutes for hardening WordPress. After working through what Maurizio said and tweaking some of the code so it works better for us, below is what we found.
Disclaimer! Some bits require adding code to the .htaccess, wp-config.php and functions.php files of WordPress. If you don’t know how to do this, ask your web developer (or — shameless plug — call me at Pivotal Web Solutions).
Why harden WordPress?
All systems are vulnerable. No matter what. And because WordPress is used by over 25% of all websites on the web (July 2016), it is by far the biggest platform to attack. There are five main dangers that could put your website in danger:
Human errors. These are things we forget to do (because we’re human after all!). Removing the admin username, forgetting to add a strong password and forgetting to update to the latest version of WordPress are some of the most common.
Exploitation. Attackers find an unpatched vulnerability in a plugin or theme and access your site this way.
Social engineering. This is when hackers collect personal information from your website and using it against you.
Brute force attack. A trial and error method used by bots that attempt to decode passwords and usernames to access your website.
Write & execution permission. When permissions are left open it leaves a back-door for attackers.
Before you even launch a WordPress site make sure you have a good host that will protect your server from attacks. Once you have done that, harden your WordPress website using the ten tips below.
Ten Tips for hardening WordPress against attacks
Before we even start the technical bits, ALWAYS keep your site updated. WordPress is constantly fixing security patches so having the latest version is a necessity.
1. Test your backup
You should be taking regular backups of your website. Make sure you test these occasionally before disaster strikes. This means you will be able to recover quickly if anyone does access your website. There are many plugins available to help you with your backup (for example, UpdraftPlus and VaultPress) or you can do this manually.
Sometimes having too many plugins on your website can slow it down or cause two plugins to conflict with one another. Fortunately, Master Blogging shares how to carry out a manual backup of your WordPress website without a plugin, an option which can give you more choice and control about how and what you backup on your website.
2. Prevent user enumeration
Deter hackers by removing username information. User Enumeration is a process WordPress uses to create author pages (visit this url: http://yoursite.co.uk/?author=1 on your WordPress site and see where it directs you to). It doesn’t take long to be able to find the actual username in Page Source even if you are using a nickname.
3. User permissions
Limit the number of users and the permissions they have to an absolute minimum. This means if hackers do manage to get into your Dashboard, they will not have full access to your site.
4. Hide your login
Move your login to a custom login page so the /wp-login and /wp-admin pages are unavailable. The plugin Custom Login URL plugin works well for redirecting the pages.
5. Don’t show errors & unnecessary info
Remove login errors, WordPress version and readme files to limit the amount of information provided to hackers.
6. Deny PHP execution
If hackers get access to your website, they can hide PHP files in folders that they should not be able to. For example, most access files disguise themselves in the /wp-content/uploads/ folder. By disabling PHP execution in this folder you will improve your security. To do this, you need to create a brand new .htaccess file to put into the contents folder.
7. Remove inactive plugins
Remove any useless or inactive plugins. If you have the knowledge you could integrate plugins functionality inside your child themes. In terms of plugins, less is more. The more plugins you have, the more you are relying on a third-party source to remove any vulnerabilities or problems that will allow hackers a backdoor into your website.
If you work on a website that has a few users, you can easily disallow front-end plugin and theme updates and installations to limit any problems.
8. Use a secure password
Everyone says this, but there really isn’t any excuse! Don’t be lazy, use a very strong password. You could use a password manager such as Keypass to keep them safe or use a method that is logical to you to remember them. For example:
Phrase + numbers + symbol e.g.:
My son likes playing with his red ball = mSlPwHrB
Addicted to WordPress = @ddic3d.2.WordPr3ss
9. Custom directory structure
WordPress comes in a standard structure (obviously) which you rarely see on the front-end of your website. The standard file structure is:
-WP-ADMIN -WP-CONTENT -WP-INCLUDES
However, by applying your own custom structure, you can not only make it look nicer but it also means brute force attacks will fail. For example:
A WordPress black hole adds a hidden link to your website’s robots.txt file that forbids bots from following the hidden link. Bad bots that ignore the robots.txt rules will fall into the trap and be denied access to the rest of your website. You can also choose to receive information about the blocked bots via email. I’d recommend using Blackhole for Bad Bots plugin for this but if you fancy a challenge, or don’t want to add an extra plugin, you can follow these instructions on Perishable Press.
So there you have it. By using these methods, you can harden your WordPress site against attacks. If you don’t know how to edit your .htaccess, wp-config or functions.php files that are mentioned above, ask a web developer. Changes to these files can bring your website down if not implemented correctly.
Director & Senior Developer Phil designs and develops responsive WordPress and Ecommerce websites that are highly optimised for search engines and conversions. Send an email or call us on 01484 290100
Trustindex verifies that the original source of the review is Google.
we have been using Pivotal marketing for a few years now. I am very happy with the overall service and support the team have given us, helping us set up our new website nothing was to much trouble. I defiantly would recommend this company for any marketing requirements you may need
Parkside Dental Care
27. November, 2023.
Trustindex verifies that the original source of the review is Google.
Pivotal Marketing has been great to work with. Phill and his amazing team not only built fantastic websites for us but also nailed the marketing game. Their friendly approach and genuine care set them apart. We look forward working with them and improving our online presence.
Simon Hall
18. October, 2023.
Trustindex verifies that the original source of the review is Google.
We are delighted with our rebrand and new website for PWP Design Ltd. A complex brief asked Phil, Amanda and the team to visually bring together our side of the business with our sister company and provide greater clarity for our clients. As a fast growing landscape architecture practice the website needed to be highly graphical in style, showcasing our portfolio, identity and creative team. The website and branding now represents us as a design practice and I wanted to take the opportunity to thank the team at Pivotal for their hard work and collaborative approach. Thanks. Simon Hall (Director)
Matt Birch
9. October, 2023.
Trustindex verifies that the original source of the review is Google.
As a well-established charity in Bradford which supports vulnerable adults with a range of complex needs The Bridge Project recently needed a partner with the skills, experience and understanding required to help us redesign and securely relaunch our tired and out-of-date website. Pivotal were recommended by a colleague and from first contact the team at Pivotal have been excellent. They took time to understand our brief, suggested improvements, delivered quality design suggestions and managed our website launch faultlessly. Since then, they have been providing us with general support and whenever we have needed them the response is always timely and the resolution to any problem is found almost immediately. We also receive detailed feedback on website usage, updates and maintenance. Working with Pivotal has given us real confidence that our online organisational presence is of a consistent high quality, secure and well managed. We would have no hesitation in recommending the Pivotal team to anyone looking for a digital partner they can trust and rely on.
Andrew Norman
31. January, 2022.
Trustindex verifies that the original source of the review is Google.
We approached Phil at Pivotal to build our new website following a recommendation from an industry colleague. He instantly understood our brief and target audience and immediately put us at ease with our decision-making process as to which provider to choose. We were dealt with in a friendly and professional manner throughout and the team made the process very easy. The site was built in a very timely manner to a very high standard and we are delighted with the result! We would absolutely recommend Pivotal to anyone.
Bernadette Goudy
31. January, 2022.
Trustindex verifies that the original source of the review is Google.
When I needed a new web site Phil was the obvious choice for me and he has done a fantastic job. I'm really pleased with the clear navigation, great design and overlook and feel. Phil and his team are great to work with and a pleasure to recommend.
Kerry Leigh
10. January, 2022.
Trustindex verifies that the original source of the review is Google.
Phil and the tam at Pivotal Marketing have done an excellent job of building me a brand new website for my business. A family member recommended I use them and I'm really glad I did.
They were very professional throughout the process and the build took no time at all. I struggled with knowing what I wanted it to look like, but with guidance it really surpassed what I could have imagined.
Great service and fantastic job, worth every penny. Thank you! I'm just sorry it's taken me so long to leave a review.
Raffaella Hinchliffe
21. September, 2021.
Trustindex verifies that the original source of the review is Google.
Pivotal Marketing Ltd are an excellent team. They are professional, yet friendly, reliable and accommodating to the needs of our business. They are proactive and quick to respond to our calls. I cannot recommend them highly enough.
James Burgess
20. September, 2021.
Trustindex verifies that the original source of the review is Google.
We was recommended to Pivotal by another of our customers as we wanted to refresh the website. What we finished with was beyond we we had hoped for. All the team have a professional but friendly approach and time frames managed excellently. Would highly recommend
R A Sidebottom Roofing Ltd
14. September, 2021.
Trustindex verifies that the original source of the review is Google.
Just had a full website refresh carried out by Pivotal Marketing Ltd and I’m very happy with the results.
As always, Jayna was very knowledgeable and professional, a pleasure to deal with.
I would highly recommend the team at Pivotal for the wide range of services they provide.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent. View our full Privacy and Cookie Policies.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.