Wordpress

default-filters.php Error

Wordpress
Wordpress

Seen this error in your wordpress and don’t know what to do?

Parse error: syntax error, unexpected '<' in
/home/pinkgar1/public_html/wp-includes/default-filters.php
on line 229

It’ s one of those situation that drives you nuts. Seeing your blog totally messed up and don’t know what to do. Because this error made your blog totally inaccessible.

I got to know that this error was quite common. Since if you google it, there are a lot of links that are shown. Unfortunately, there isn’t a single one that point out the solution. The best reference I can found is this blog post, A look at WordPress filters. Disable wpautop() on post formatting.

Now, it make sense why this error can totally messed up your blog.

First of all, what is a filter? WordPress filter is a type of hook (another type is action hook, which we briefly look at while writing first WordPress plugin). Filters allow data modification on-the-fly. Which means you can change something after it was read and compiled from the database, but before it is shown to your visitor. Or, you can modify something a visitor sent to your database, before it is actually written there.

….

A good way to start playing with filters is checking out what defaults are and how they work. Default filters are listed in wp-includes/default-filters.php file. From this list, you can learn the names of some filters, the names of functions which are called, and the order in which they are called.

So, every blog has it’s own default-filters.php. I compared mine with other’s and I got this error because I uploaded the wrong file. I just mixed things up >.< But uploading the right default-filters.php doesn’t make it go away. Luckily, I ‘ve noticed that all the javascript files were also changed at the same time. And I mean all, including your plugin’s javascript.  It means that default-filters.php have something to do with the way these javascript files generated. So, you need to restore these javascript too.

So, what is the solution? Just replace all your wp-content and wp-includes files with yesterday backup. If you don’t have it, just ask to your hosting support to restore it. It will be just too painful to restore one by one these javascript files because they are all over the place. I did this and as you can see my blog was brought back from the dead. Hope, this will help you my fellow bloggers 🙂

2 thoughts on “default-filters.php Error

Leave a Reply

Your email address will not be published. Required fields are marked *