Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/sites/w/wpforjournalists.com/public_html/wp-includes/pomo/plural-forms.php on line 210

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/sites/w/wpforjournalists.com/public_html/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 77

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/sites/w/wpforjournalists.com/public_html/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 87
Troubleshooting – WP for Journalists

Photo by Steve Johnson from Pexels

Launching and running a website is exciting but also scary – particularly when things go wrong. The process can be very stressful especially at 2 AM when you’re trying to troubleshoot a problem. This is why it is very important to have a clean backup of your site saved and have a good, reliable, helpful host who offers 24-hour, 365 days a week telephone help.  As you spend more and more time on your site you’ll get to know the most common errors that we all face and how to fix them. In the meantime, use this guide as your first port of call. But remember, if you haven’t backed up your site and you get hacked – there will be no one to blame but you!

Chapter 6

  • Site slow This is usually a server issue so first check with your host to see if there are any issues. Next check to see whether one or more of your plugins is the cause – deactivate all your plugins – check to see whether this has made any difference. If it has – reactivate each plugin one by one to identify which one is causing the issue. This quite often happens when there is an update of either WordPress or an individual plugin sometimes there are compatibility issues. Have a look at the section on performance for tips on improving the site speed generally.
  • Locked out of the WP dashboard  Have you forgotten your password? Can’t access the email account in order to reset it? Don’t panic. Here’s how to reset your login information:
  1. Login to your host cPanel
  2. Find MySQL database for your website
  3. Log onto the PHP admin area ( this is usually a different username and password that  you used to log into your cPanel)
  4. Once you’re in your database (make sure you have selected the right server)  click on the database name and find users
  5. Click on users – find your username and click edit
  6. You should see a number of boxes – Look for user_ pass –  it will have random numbers and characters
  7. Delete this random password and enter your new one
  8. There should be a drop down box next to the password or underneath it labelled functions – click the drop-down and select MD5 (this will encrypt your password)
  9. Check save and try logging in to your WordPress dashboard /wp-admin
  • Error establishing a database connection If you see this message this means that the username or the password in the WP-config.php file is incorrect.  This will happen if you have just changed the password to get into your database (please keep a note of all these passwords). To fix this error find the WP-Config.php file using your FTP. Open the file in TextEdit and check to see that there are no errors in either the database name/user or password.  Be very careful – spaces, wrong characters and of course mistakes, will block you from accessing your site. Don’t delete the single quotation marks – and if you do and you need to put them back – copy one from somewhere else in the file and use that – I always have a problem with my single apostrophes on my Mac because they are slanted and the code doesn’t like them – they must be the straight ones.

To change Microsoft Word from slanted/curly quotation marks to straight quotation marks, click on Tools – autocorrect/autoformat as you type … and then uncheck the box that instructs the text to change from straight to curly

  • Repair database If you get an error message saying your database needs repairing – find your WP-config file using your FTP and add the following line:

Define ( ‘WP_ALLOW_REPAIR’ , true );

Be careful with the commas and apostrophes. Save this file and then put the following in a browser:

http://www.yourdomain.com/wp-admin/maint/repair.php

And hit return.  This will activate the process. When the process has completed, go back into your WP-config file and delete the line of code. Save the file.

That should fix the issue.

  • 500 internal server error This is such a common error message and not really very helpful because it is just a generic notification which doesn’t give you any specifics about what is wrong with your site. Essentially it means there is an issue with your server – but more than that will require some investigation on your part.Starting with trying to reload the page you were trying to access, just in case it is something temporary. If this doesn’t work, try clearing your browser cache. Next delete your browser cookies. If you’re still getting the 500 message close everything down and retry. If the issue still exists, go and have a cup of tea. Sometimes the problem is outside of your control and someone else i.e. your host will be fixing the problem.If the issue still hasn’t resolved itself within a couple of hours, the issue may well be a permissions error or PHP timeout. For this I would contact your host to help you identify exactly what the problem is.  You’ll need more specific help.
  • 404 error If you see this error when you are trying to access a post or a page  that you are sure has been published and is publicly available, one of the first things to try is refreshing the permalinks.  Go to the dashboard/settings/permalinks and scroll to the bottom of the options and hit save changes. This has fixed the issue for me many times. If this doesn’t fix the issue – you might need to manually do this.  Find your .htaccess file using your FTP and change the file permissions to 666 this makes the file writable. Save this file and go back to your dashboard and do the permalinks save again.  This should sort the problem out. If it does go back to your FTP and change the file permissions of the .htaccess file back to 660.  If you’re still getting an error message contact your host.
  • 403 forbidden access This error message is usually caused by a security plugin not being configured properly, or you could have a corrupt .htaccess file.  The first thing to do is to deactivate all your plugins and then reactivate them one by one to isolate the problem. If it isn’t one of your plugins try deleting your .htaccess file.  Find it using your FTP server – delete it and then log back into your site, dashboard/settings/permalinks and hit save. By resaving your permalinks you will force a new .htaccess file to be generated – this should fix the issue.If you can’t get into your dashboard at all your IP address may have been blacklisted – sometimes this happens when you are trying to update something or change a password and the process gets interrupted and then WordPress blacklists your IP. First find out what your IP address is by putting http://ip.me.uk in the browser. This will give you your IP address. Once you have this, contact your host and tell them you think your IP might have been blacklisted – they will be able to whitelist you and put you back on track. It’s an easy fix.
  • White screen of death This will give all new website owners palpitations –  your website appears to be gone – with not even an error message. Just a completely white screen. Don’t panic!This is quite often caused by exhausting the memory limit set by your server. This can be quite easily fixed by increasing the memory limits – by default this is set to 64MB –  try increasing this to 256M.

    To do this: Find your WP-config.php file  using your FTP account and add following code just before the line ‘That’s all, stop editing! Happy blogging!

    define ( ‘WP_MEMORY_LIMIT’ , ‘265M’ );

    save this file.

    That should have fixed the issue if it was a memory limit problem. If not, it could be a rogue plugin so deactivate and reactivate all plugins to check or it could be a damaged theme so try switching to a WordPress default theme and see if the problem still exists. If the problem is still there, try installing a fresh copy of the latest version of WordPress. If that doesn’t work you need more help than I can give you here, so contact your host.

  •  Memory exhausted error See white screen of death
  •  Parse error, Syntax error, unexpected This error message should give you exactly where there is a problem – it is a coding issue and means there is some mistake in the code.  Quite often it is a missing comma, or the wrong quotation mark (curly instead of straight).The error message will state the location of the problem code and the actual line number where this problem is. What you need to do is locate this file and find the line number. If it is piece of code that you have just added, then replace it with the original code (that you will have saved prior to making any changes). See if this fixes the error. If it does you need to find out what is wrong with replacement code. If you can’t figure it out, ask your host.
  • Connection timed out This could be to do with your plugins –reactivate them all then reactivate one by one to isolate the issue. Or it could be an issue with your theme – switch to a default WP theme– If this fixes the issue then it is something to do with the theme you are using.  Or it could be a memory limit issue –see White screen of death.
  • Briefly unavailable for scheduled maintenance You can get this message sometimes when you are updating a theme, plugin or WordPress version. It’s really just a notification rather than an error message. WordPress creates a maintenance file during any updates and if the message saying your site is unavailable doesn’t go away by itself you will need to find this .maintenance file using your FTP and delete it.

If you can’t see a file that you’re looking for in Filezilla, click on server/force showing hidden files

  • Images not uploading/broken links Usually if you get an error message when you are trying to upload an image onto the media library, it is because you are trying to upload the wrong file type. WordPress accepts JPEGs and PNGs –it will not accept Tiffs.  So the first thing to do is to check the file type. If you have to correct file type and are still having difficulties it could be a file permissions issue. Find the upload folder on your FTP ( usually in WP-content)  and check that the permission is 744 (try 755 if that doesn’t work).  Check the box – apply to directories only, hit ok, then open the file permissions again and check the box – apply to files only, and put 644 in the numeric value box, click ok. This should fix the issue –  if It doesn’t, contact your host.
  • Sidebar below content If the summaries in your sidebar appear below your content instead of where they should be, it could be that there is an error in your HTML code, or your CSS code or there is a plugin issue or something incompatible with your theme.First try deactivated all the plugins and reactivating them one by one to see if this is the issue. If you’re still experiencing problems the most likely cause is that there is a div tag in your HTML code that hasn’t been closed or there is an extra <div> or </div> that isn’t needed.  To find out which pages/posts are affected – click through your site making a note of where the sidebar is out of place.  Once you have identified the pages or posts try editing the content first – click on edit and in the text tab, highlight all the text and hit close tags on the toolbar. This will add any missing </div>  tags.

    Then check to see you have no extra tags – if you do, delete them.

    If this doesn’t fix the issue then you will need to check the page/post code. Go to dashboard/appearances/editor and find the single post/page (page.php). Open the file –  remembering to make a copy of the code before changing anything – check through to see if you can find any errors with the div. tags.  If you are still experiencing problems, contact your host.

  • Are you sure you want to do this? This usually happens when you’re trying to upload a new theme or plugin. Sometimes it is a problem with the code. First try deleting the theme or plugin you were trying to upload and try uploading and activating it again. Sometimes this works on the second try – if it doesn’t then the easiest thing to do is to try and find an alternative if it is plugin that you were trying to upload or contact the developer if it is a theme issue.If it is neither a plugin or theme issue, it is most likely something to do with the unique keys in the WP-config.php file.  You can try opening up your .config file and deleting all the define lines in the authentication unique keys and salts section.  If this doesn’t work contact your host.
  •  Not sending emails This is a very common problem with contact forms (and newsletters) and one that can drive you mad. My solution is not to use contact forms at all –  I always just have contact buttons allowing a visitor to email me directly rather than using forms. If, however, you want to use a contact form and you’re having an issue sending or receiving emails from the site, this is usually something to do with the configuration of your PHP mail function.Trying to figure out exactly what the issue is can be time consuming and require some knowledge of email servers – I suggest that you talk to your host before doing anything, to see if they can isolate what the issues for you. Then you can try and fix it.

    You can also try adding an SMTP plugin, which will reconfigure the WP-mail function – this has worked for me in the past. Try WP Mail SMTP – developer Callum Macdonald