If you are having problems with your WordPress website downloading a file instead of opening the site itself, this is due to a misconfiguration likely caused to the .htaccess file. Luckily we can do a few troubleshooting methods to get your WordPress website working again, So don’t panic just yet.
So in this guide, I have listed different ways you can fix your WordPress site downloading a file instead of opening the website.
If you are worried that your website has been hacked or been attacked don’t be, as the chances are as I already said. The cause of the problem is due to something simple such as a setting being set up incorrectly, especially if the problem has only just occurred while you were on the backend of WordPress. However, it could still be the problem but that would be the last thing to check.
Related: How to fix WordPress backend slow
What causes WordPress site to download a file instead of opening?
There are a few things that can cause this issue it could easily be a misconfiguration to your htaccess file. Perhaps a plugin or a newly installed plugin has made a change and your server is disagreeing with it causing a file download instead of opening your site, not having the latest server updates installed can also be another factor or a caching plugin could be conflicting causing this problem.
Why is my WordPress site downloading a file instead of opening?
The first and easiest thing to do is restart/reboot your server, there could be a service or something on the server that has become stuck that’s causing the download file problem.
Just remember when you do reboot the server it will make your website and other sites that are hosted on the server become unavailable and offline.
If you are not sure how to reboot the server that your WordPress website is hosted on then you might need to reach out to technical support and ask them to do it.
Check .htaccess file
The .htaccess file controls many things when it comes to your WordPress site. Your htaccess file might contain redirects, cache configurations, firewall plugin settings, allowed or blocked IPS, etc.
So as you can see you can control a lot on your website using the .htaccess file, but also a lot of plugins communicate with it and one of these plugins might have made a change that is causing the problem that you are having.
So check your .htaccess file and make sure there is no newly added code that is causing the problem.
One of the plugins that you have installed in WordPress could be causing the issue, caching plugins like WP Rocket can easily cause the file download issue especially if you are hosting your WordPress site on a LiteSpeed server.
So disable all caching plugins, then restart your web host server and see if that fixes the issue, if it does then you know it’s a problem with the caching plugin that you are using.
Update your server
Make sure you have the latest updates installed for your server. If you do not have access to update the server then you will need to reach out to server support, and ask them to check if the server is running the latest updates.
Update your web host control panel
Again same as updating your server make sure you also have the latest updates installed for your web host control panel, so if you are using Plesk, CPanel, CyberPanel, etc go into the settings of the control panel and ensure there are no updates available.
If you are not the administrator or signed in as a root admin, then you might not have the option to be able to check if there are any new updates available for your web host control panel. So you will need to reach out to your host and ask them to check if everything is up to date.
Check WordPress for security threats
The final thing to do is run a malware scan on your WordPress site, we can do this for free using a plugin called Wordfence Security. So head over to the plugin store in WordPress and search for Wordfence, then install the plugin. Once the plugin is installed follow the setup process to get the plugin running then run a full scan on your site.
Once WordFence has finished scanning your website for security issues, it will then give you a list of actions you can do to fix the security problems for your website.
If security problems where found then Wordfence should help fix this, and get your site back up and running securely.
You can check out the Wordfence plugin page here.
It can be scary when your website stops working and you are not able to access it, but luckily there is usually a simple solution and it’s usually a setting or plugin that you have enabled that has caused the problem.
If you are still having issues with not being able to access your WordPress website then I would suggest you reach out to your server support, and see if they are able to help fix the problem. Let them know that your WordPress website doesn’t open and loads a download file instead.