This error usually occurs when you are trying to add code into WordPress files and have accidentally missed something or the code has incorrect syntax. You will see the result into a PHP parse error and you will see a notice like:

Parse error – syntax error, unexpected $end in /public_html/site/wp-content/themes/your-theme/functions.php on line 369

The error message would show the unexpected thing found in the code and the location of the script where the error occurred with line number. To fix this issue you will have to correct the syntax. Most of the time it is just a missing bracket, or some unexpected character in the code.

Things to do

1) If you pasted the code using your WordPress dashboard Appearance » Editor section, then you are locked out. The only way to fix this is to access the file you last edited using FTP.

2) Once you’re in the FTP, you can refer to the error on your website, it will show exactly which line the error is.

3) You can now edit the code with the right one or just remove the code.

4) Refresh your website just to be sure. And you’re done here.