Inbound Rocket

WordPress Tips: Common WordPress Errors and How To Fix Them (part 2)

WordPress Tips: Common WordPress Errors And How To Fix Them (Part 2)

In our previous blog post, we started talking about the most common WordPress errors and how you could fix them. We talked about the following problems:

  • Internal Server Error
  • Syntax Error in WordPress
  • Auto-Update Failed
  • Error Establishing A Database Connection
  • Briefly Unavailable for Scheduled Maintenance Error in WordPress
  • Sidebar Below Content Error

Today we will continue on our journey to help you get rid of those pesky WordPress errors, so you can focus on your business again.

Notice: Before trying to resolve any of the below errors, make sure to have a full backup of your WordPress site. If you don’t know how to do this, try contacting your hosting provider, they should be more than willing to help out!

#1 Email Password Retrieval Does Not Work

At one point or another in life, we all forgot our password (that was before password managers, but since not everyone is using them it is still relevant). It can happen to the best of us, so you are forced to use the “Lost Your Password” page. For some strange reason, however, the password reset email is not ending up in your inbox. Although this can be irritating off course the main problem is not really why you aren’t receiving that email, but you want to reset your password easily and quickly.
To reset your password easily and quickly you can do this in two different ways:

a. Edit your functions.php file:
This is the least technical solutions of the two, the “functions.php” is responsible for a lot of things on your WordPress website. If you want to quickly reset your password and the email is not showing up do the following:

Navigate to “../wp-content/themes/your_live_theme/” using FTP or File Manager and download the functions.php file.
Open the file in your code editor and add the following code:

wp_set_password(‘YourNewPassword’, 1);

Replace YourNewPassword with your desired new password. Number one (1) in our little code snippet is your user ID number from the wp_users table. If you now Save and upload your edited functions.php you can login to your WordPress again. After you made sure you can login, delete the code (download your functions.php again, delete the code and upload it back to your theme folder).

b. Reset your WordPress password via phpMyAdmin
Although this one is a bit more technical, it is still pretty easy and probably the one that takes the least amount of time.

  1. Login to your phpMyAdmin on your server (if you have a hosting provider this is most likely located in your hosting admin panel).
  2. Select the database of your WordPress installation.
  3. Select the “wp_users” table and click on Browse
  4. Go to your username and click on Edit
  5. Enter a new value (this will be your new password) into user_pass
  6. Be sure to select MD5 from the drop-down menu (located under Function)
  7. Click the “Go” button at the bottom to save your changes

#2 How to Fix Image Upload Issue in WordPress

Sometimes you can suddenly notice that all the images from your WordPress site are gone and are showing broken image placeholders. When the you try to upload an image to a post using the media uploader, it results into an error. All these files in the media library will appear as broken. This error occurs due to incorrect file and directory permissions in a WordPress installation. A number of factors may cause this issue.

It’s possible that your web hosting provider ran an upgrade and something caused the file permissions to change. It might also be possible that a hacker made those changes while uploading a backdoor hack. Or on a poorly configured shared hosting, it is also possible that when one user installs a theme or plugin from an unreliable source, the script ends up mistakenly changing file permissions for everyone.

If everything else is working fine on your website, then you just need to change file permissions back to normal. When in doubt, just can always ask your hosting provider for support.

To fix the file permissions, fire up your FTP client and go to the “/wp-content/“ directory. Right click on the uploads directory and select “file permissions”. Change your permissions to “744” for only the uploads directory and all of it’s subdirectories. If setting it to “744” doesn’t work, try setting it to “755”. After you’ve changed all your directory permissions we still need to change the permissions of the files within the directories. Change the permissions of the individual files to “644”.

Once it is done, you can go back to your WordPress admin area and try uploading images again.

#3 Connection Timed Out Error

If your WordPress website lives on an overused shared server, you will see this WordPress error more often than not. The error can be caused by either heavy plugins, theme function errors or an exhausted PHP memory limit.

To do a proper check of which of these three is the cause of the timed out error, try deactivating the plugins you installed recently or reset your plugins folder at first. If this works, try contacting the creator of the plugin and asking him to fix the error. If this doesn’t work try changing your theme to the default WordPress theme. Just like with the plugin, if this fixes the problem try contacting the creator of the plugin.

If both don’t work try increasing your PHP memory limit. As described in our previous article this can easily be done by creating a file called “php.ini” and putting the following line in this file:

memory=128MB

Save the file and upload it to your “/wp-admin/“ directory. This off course goes on from the premise that you are currently using only 64MB for example, otherwise you can always put something in here like 256MB etc.

#4 Warning: Cannot Modify Header Information – Header Already Sent By

This is yet another common WordPress error that troubles many WordPress users. If you do encounter this error, you will usually see something similar to this:

Warning: Cannot modify header information – Header already sent by (Output started at /public_html/your_site/wp-config.php:26)

That last part (Output started at /public_html/your_site/wp-config.php:34) tells you exactly where your error is coming from. The error is caused because of the presence of white (blank) spaces in the affected file (in our case above, that would be wp-config.php)

This fix this error you will need to remove the unnecessary white space in this file:

  1. Download the affected file (e.g. wp-config.php) via FTP
  2. Open the file in your favourite editor
  3. Remove all spaces before the first <?php (The first <?php should be in the first line)
  4. Remove all spaces after the closing ?>
  5. Save and upload your file again

#5 The Plugin Won’t Delete Error

Some plugins mostly terrible coded ones) come with hidden files that become a pain in the neck when you want to delete the plugin. This is a good reason to only download plugins (and themes for that matter) from reputable websites you trust. The problem is you can’t delete the plugin via WordPress Admin and even if you delete the plugin’s folder via FTP, the plugin still appears. Magic? Nope… The plugin came with hidden or nested files

To fix this problem we will need to enable the show “hidden files” option in your FTP client. This will show you directories and files starting with a “.”. Because they are hidden they can’t be automatically removed via the WordPress backend. If you can see these hidden files via your FTP client, delete the entire directory and the plugin is finally gone. Another way is using SSH access to your WordPress site. Login to your blog using SSH and navigate to the “/wp-content/plugins/“ directory. Using “ls -al” you will get a list of all your directories. You can delete the directory causing the problems using the “rm -rf directory-name” command.

This solution will only work if you have SSH access to your WordPress site. This is what to do. Login into your blog using SSH and navigate to “/wp-content/plugins/“. Use the Is -al command to list all your folders, and finally delete the problematic plugin using the “rm -rf (folder name)” command.

Prevention is always best off course, so next time you install a new WordPress plugin make sure you download it from a reputable source like the WordPress plugin repository.

#6 WordPress Posts Returning 404 Error

We can understand that it is really frustrating to be able to access all pages of your WordPress website, but you can’t access the individual blog post. Every time when you visit a single post, you’re getting a 404 error page.

The reason you are getting this error is due to some problems with your permalink settings and can easily be fixed. First thing to try is to got Settings > Permalinks and press “Save Changes”. This will most of the times already fix your problem.

If this doesn’t fix it however it might be time to edit your .htaccess file because there might be something wrong with it. Using your FTP client, navigate to your WordPress root directory and download the .htaccess file. If it doesn’t exist yet, create a blank text file and save it as .htaccess. After you’ve download the file (or created one) add the following lines:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Save and upload the .htaccess to the same location, the problem should now be fixed.

#7 WordPress Memory Exhausted Error

You know you’ve encountered this error when you see the white screen of death or this error message:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home/username/public_html/your_site/wp-includes/plugins.php on line 38

The reason you are getting this error is that there is a plugin or a script eating away all your memory. Try installing P3 (Plugin Performance Profiler) to try to determine which plugin is causing the biggest chunk of memory use and disable the plugin (try contacting the author of the plugin too to let him or her fix the problem). Next to this try increasing the memory limit for your WordPress install as described in the “Connection Timed Out Error” tip above.

#8 Fatal Error Undefined Function is_network_admin

The Fatal Error Undefined Function is_network_admin error is a result of a failed auto update. The easiest way to solve this problem is to update your WordPress installation manually. (sometimes a problem and a solution isn’t that hard ;-))

#9 How to Fix WordPress Login Page Refreshing and Redirecting Issue

The last error we would like to focus on is a refreshing Login Page or a redirect straight after logging in to you backend. WordPress uses cookies for login authentication, sometimes there might be a small problem with your local stored cookies or your browser cache. Let’s first try to clear your bowser cookies and cache. Also make sure that your browser has cookies enabled. After doing that restart your browser and then try to login again. This should resolve the issue for most people.

However sometimes this error is caused  due to incorrect values for “site url” and “home url” fields in the WordPress options table. In some cases defining the site URL seems to fix the issue. To do this, you need to login to your site using FTP and edit the “wp-config.php” file. Simply add these two lines of code in your wp-config.php file and don’t forget to replace the example.com with your own URL. Also if your site is located at  “www.” then make sure you add that.

define(‘WP_HOME’,’http://example.com’);
define(‘WP_SITEURL’,’http://example.com’);

Save changes, and this should resolve the redirect issues.

We hope these two articles helped you resolve WordPress most of the WordPress errors you might encounter on your site. Let us know which error was causing you the most headache and if the solution helped in the comments below. If some errors and methods are not mentioned in this or our previous article let us know and we can always update the article! Let’s try to make these a complete user guide for fixing your most common problems.

This entry was posted in WordPress. Bookmark the permalink.

Found this article interesting?
Subscribe to our newsletter!

No spam, ever. Your email address will only ever be used for notifications regarding our blog posts and product releases. If you want you can easily unsubscribe with a single click at any time.
What others are saying about our newsletters:

  Inbound Rocket's weekly newsletter delivers on its promise. It's action packed full with relevant knowledge to help me drive my business to the next level.  

Martijn de Kuijper

Founder of reinvented newsletter service Revue

  I've subscribed to a bunch of marketing newsletters and unsubscribed to the most of them.
 
The most value comes from these mails. I like how Inbound Rockets puts an extra dose of great info into the mails as an addition to the blog articles you're promoting. And they are great as well.
 
Keep doing what you do!  

Andi Herzog

Music Producer

Follow us

Pin It on Pinterest

Shares
Share This
×

Awesome, actionable marketing advice. Delivered weekly.

Join over 2,000 good-looking folks who get our latest content first 🙂


Here’s what you can expect from us.

And don’t worry, we hate spam too! You can unsubscribe at any time.