How to fix error thrown $this when not in object context? My website was still live and working fine. However the WordPress admin dashboard would not load, at all. I just kept getting the same message from the browser. Arrrghhh What to do, well after some digging I found a very simple fix. This tutorial will show you how to fix the WordPress syntax error and return your site back to normal.
Since your dashboard cannot be accessed, you would need to access your site files and make edits using an FTP client.
I use a free program called FileZilla to access my files, you can download it for free here. You will need your cPanel details for this and you can contact your web host for the details if you do not already have them. You’ll need host address of the server, username, password and port number to connect.
After successfully accessing your site with FileZilla follow these simple instructions:
-
Open your root directory
-
Open your wp-content folder. Mine was in the Files folder.
-
Rename the plugins folder to anything you want, I just added a 1 to the end and that will deactivate all of your plugins.
-
Refresh your site and if the error has disappeared you should now be able to log back in to your dashboard. It was caused by a faulty plugin.
- Go back into filezilla and rename the plugin folder back to its original name. You’re done with filezilla.
-
Now enter your dashboard, activate each plugin one by one, refreshing your site after each activation.
-
Once you find the faulty plugin, delete it. Replace it with something else, if it’s function is essential to your site. Otherwise, you may need to consult the plugin’s developer.
Fingers crossed this fix has worked for you as it did for me, happy blogging 😊
If you found this helpful, please like and follow my social pages