A syntax error message might be generated after an update such as a plugin, a WordPress theme, or an edit to one of your WordPress files. All it takes is a simple recurring error, and you can generate this error message.
To show you how this error works, I will generate this error. As you can see, our WordPress website looks great, and everything is fine. So let’s create this error. Again, many times if you are updating or uploading a plugin or a theme, you could get a conflict to cause the error.
You could often find that if you are updating a WordPress file, all it takes is missing a comma for the error to be generated. So let’s do that now.
As a side note, if you are only making changes to your WordPress files, it would be beneficial to make a backup. Ok, so I am simply going to Appearance and then to Editor. I am simply going to go and choose a file. I will choose the functions file, and as I here in the function.php file, you can see there are many lines of code.
You have semi-colons, parenthesis, dashes, and many items here. To show you how simple it is to get this error, I will simply delete this comma. I will update the file, and now the website will break.
Not that you want to have a WordPress error, but compared to other WordPress error types, this one is beneficial because it lets you know where the affected file helps you as you were making changes to your WordPress files where to go find it. If I try to refresh to go back to the main domain name, I cannot log in. So, we must find an alternative way to edit the file.
For this demonstration, I will be using Filezilla.
Filezilla is a free FTP solution that you can download and transfer information between your computer and your website server. Since we cannot log in to our WordPress platform, we need to get in there via FTP.
Simple login to your website, and since our error lets us know where the file is located at. We are just going to follow the command. Once you are where your file is, you have multiple options. You can drag it over and edit it directly on your computer.
You can right-click on it and download it, or you can right-click on it and view and edit. Now, I have no pad connected to my Filezilla. You may need to connect a text editor to your Filezilla. So, I am simply going to right-click, click view and edit and my notepad initializes. This text editor will allow us to fix our errors as we go down, see where the error was, and paste it. Again, if you know where the error is that you are working on your website, you can go back and fix it. I will file, click save, closeout, and refresh the website. As you can see, that fixed the website.
Again, if you work on your WordPress platform, there might be times you work on files. You may add too much code, not enough code, or enter a command that conflicts with your WordPress platform.
Now, if you do not have access to FTP, but you do have access to your cPanel, let’s try this again using your cPanel. I am simply going to regenerate this error. I’m going to Appearance and then to Editor.
So I will find the functions file, and now I am simply going to delete something else. The last time I deleted a comma, I deleted a semi-colon, and I will update the file. Once again, the website has crashed.
You can see the syntax error here, letting you know where the file is and in which line. So this time, we are going to log in through our cPanel. Once you have logged in to your cPanel dashboard, look for a file named File Manager. you are here, follow the error message’s path.
Once you have found the file, go to the code editor. Now that you are here, you have options between choosing between the lines of code and using a text editor like notepad.
Again, we were making editing changes just like you might be adding changes to your WordPress files. We know exactly where to go, what to delete, and how to proceed. I am simply adding the coding back in and clicking on save changes. I will go back to the website and refresh, and once again, the website has been fixed.
If you enjoyed this article, then you’ll really enjoy the 24/7 WordPress website management and support services it has to offer! Partner with the team that offers every aspect of premium WordPress support services.
Our expert engineers have your back from speed optimization services to unlimited website edits, security, 24/7 support. Bring us in as part of your team to make your site Bufftastic! Check out our plans.