, ,

Common Errors in WordPress and How to Fix Them

Sometime we face problems in our WordPress site. Today i’ll discuss three common error of WordPress and possible ways to fix them.

How to fix WordPress Syntax Errors

Most of the time a beginner face the syntax error. It’s a common problem in WordPress. Most of the time the problem caused in php file. When there is a missing syntax like semicolon, colon,underscore or any types of syntax that are used in php we get a error message on browser. If you face the same problem don’t be panicked. It’s easy to solve .

( ! ) Parse error: syntax error, unexpected ‘,’ in C:\wamp64\www\test_site\wp-content\themes\twentyseventeen\functions.php on line 376

There is a syntax/parse error in my twentyseventeen theme’s functions.php file on line 376.

So we’ll locate functions.php file find the problem and fix it.

syntax error

Syntax error


Here in the function.php’s 376 number line there is an additional comma(,) that is causing the error. Just remove the comma(,) and save the file. Then reload the page. And it works fine.

How to Fix 404 Not Found Error

 

Fix in Permalinks

Most of the time this error is caused for your permalinks structure. If the problem caused in permalinks then simply navigate to Dashboard->Settings->Permalinks. Set the permalinks type to Post name as shown below and save changes.

Permalinks structure

Permalinks structure


Hope this will work.

Edit .Htaccess

Sometimes this problem is caused for .Htaccess file in your theme. Modifying that file may solve the problem. Make your .Htaccess file like shown below.

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

# END WordPress

Note: Here tests_site is my site directory on localhost. Use your own.

How to Fix Connection Timed Out Error

Sometime we face this error that say Connection Timed out. This may cause for exceeding maximum execution time but no response from server.

May be you are using a shared bandwidth that are slowing down your server. In that case upgrade your hosting plan.

Sometimes it may caused for a plugin. To solve this deactivate your plugin one by one and detect where it lies in.

Increasing your php memory may solve the issue. Just go to  wp-config.php file and add the line below.

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

 

To get more tips and tricks like this stay with Code Astrology.