How to Fix WordPress Memory Issues When You Can’t Log into the Admin Backend

What Is This Nerdy Article About?

Before we get into the details, this article is a little outside the normal content I share on this site. Issues with servers, PHP, WordPress, and general Website issues are one of my highest areas of expertise. This particular issue where a WordPress site becomes unaccessible after installing a few plugins is common and many unexperienced WordPress users will likely run into this issue at some point in their management of a WordPress site. I felt sharing an article like this may be of value, even if it’s a little outside the topic scope for what’s usually found on my site. So, let’s get into it!

If you’re running a WordPress site and suddenly find you can’t log into the admin backend, it might have to do with the memory settings on your server, don’t worry! Here’s some easy stuff you can do to fix it.*

* Disclaimer, I’m assuming you’re using some kind of shared hosting, so these instructions are for cPanel. If you’re a nerd like me and will be modifying your php.ini file, then just scroll down for the settings I provide and update accordingly.

Step 1: Log in to cPanel

First off, you’ll need to log in to cPanel. This is where all the magic happens. Use the credentials your hosting provider gave you.

Step 2: Find the PHP Settings

Once you’re in cPanel, look for either ‘Select PHP Version’ or ‘MultiPHP Manager.’ This is where you can tweak the settings to give your WordPress site more juice.

Step 3: Choose Your Domain

If you’re using ‘MultiPHP Manager,’ select the domain that’s giving you trouble. This makes sure you’re changing the right stuff.

Step 4: Access PHP Settings

  • If you see ‘Select PHP Version,’ click on ‘Options’ or ‘Switch to PHP Options.’
  • If you’re using ‘MultiPHP INI Editor,’ you can dive right into the settings for your chosen domain.

Step 5: Bump Up the Memory Limit

Look for memory_limit. It’s probably set to something like 128M. Change it to 256M or even 512M if you need more oomph.

Step 6: Adjust Other Key Settings

While you’re at it, you might as well tweak a few other settings to keep your WordPress site running smoothly:

  • upload_max_filesize: Default is 2M. Change it to 32M or higher.
  • post_max_size: Default is 8M. Match it to your upload_max_filesize.
  • max_execution_time: Default is 30 seconds. Try 300 seconds.
  • max_input_time: Default is 60 seconds. Match it to your max_execution_time.
  • max_input_vars: Default is 1000. Bump it up to 3000.
  • max_file_uploads: Default is 20. Try 50.
  • default_socket_timeout: Default is 60 seconds. Try 300.

Step 7: Save Your Changes

Make sure to save all the changes. In ‘Select PHP Version,’ there’s usually a ‘Save’ button. In ‘MultiPHP INI Editor,’ changes might save automatically.

Step 8: Check the Changes

To make sure everything’s good to go, create a phpinfo.php file in your WordPress root directory with this code:

<?php phpinfo(); ?>

Open this file in your browser (like http://yourdomain.com/phpinfo.php) and check the settings to see if they’ve updated.

Step 9: Restart Your Web Server (if needed)

Sometimes the changes won’t kick in right away. If that’s the case, you might need to restart your web server or ask your hosting provider for help.

Summary

By tweaking these PHP settings, you can give your WordPress site the resources it needs to run smoothly, especially if it’s a big site with lots of stuff going on. This will help you log back into your admin mode without a hitch. Happy blogging!