Broken WordPress App and LightSpeed Server

If you host your WordPress site on a LightSpeed web server which is common with shared hosting providers you may have run into issues when trying to use the WordPress app with your website. It turns out LightSpeed has automatically enabled a brute force protection feature which aims to reduce the risk of attacks on your WordPress site. While all good and dandy, it presents a major issue if you use the mobile app. It aggressively rate limits both the wp-login.php page and most importantly, the xmlrpc.php page and will often force a captcha, which is responsible for a substantial part of communicating with the app. I use the mobile app all the time to start drafts or look over content, so getting this fixed was pretty important for me.

How do you fix it?

It’s easy, sorta… You just need to make at least one configuration change in your .htaccess file to override the security policy by default. I’m using DirectAdmin but if you use cPanel or any other, the steps should be similar. You need to repeat this step multiple times if you have many domains, as the changes cannot apply globally.

  1. Go into your file manager and find the directory containing the domain you want to apply the fix for. Ensure you are in the public_html folder or the subdirectory containing the root of your WordPress site.
  2. Open up the .htaccess file for editing. If you are using cPanel, hidden files may be disabled by default so ensure you enable visibility.
  3. At the very top of the file, above the # BEGIN WordPress, add the following lines into the file and save:
<IfModule LiteSpeed>
	WordPressProtect off
</IfModule>

The file should look similar to this. If you have other plugins or modifications made, your file will look different.

That is it! Well, almost unless you have a server with Immunify360 WAF. Unfortunately their rules are quite strict and so they also heavily block access to XML-RPC. Apart from finding every single possible rule to exclude from their filter, I ended up just disabling WAF for the entire domain. As long as you keep your installation fairly secure and minimal you will reduce the risk of your site getting hacked.

That’s it for this guide. You should be able to use the WordPress mobile app as normal without any issues. If you do continue to experience them, check if there are more firewalls or WAF rules that are actively blocking access to the server. If you use cPanel, this page might be of relevance. Otherwise, contact your host for support.

If you have any other tips or found that making other changes helped, be sure to comment so others that find this post can try them to! Conversely, if you thought my advice was horrible be sure to let me know.

Leave a Reply

Your email address will not be published. Required fields are marked *