Archive for May 2009

How to disable wpautop in WordPress blogs

So, when creating a WordPress blog, even if you are editing in HTML mode, WordPress includes a feature called “wpautop” that will replace any pair of line feed characters in your post markup with a <p> tag. This is helpful I think in general for people who blog mostly paragraphs with some links and images. However, if you blog with more complex markup, this can invalidate your HTML. I run my HTML through the W3C HTML Validator to check it and wpautop can cause validation to fail. I hunted around online for an easy way to disable this and didn’t see one, so I made the changes described below.

One thing to keep in mind is that if you HAVE been relying on wpautop and you have not been including your own explicit <p> tags, disabling wpautop will cause all your paragraphs to run together and thus your layout will be broken. To prepare for this, pre-edit all your posts so they have the paragraph tags and remove extra blank lines from them. You can check how they look in that state since when there are no blank lines wpautop won’t do anything. Once they look good like that, you can disable wpautop.

In your WordPress installation, edit the file wp-includes/formatting.php. Search for “function wpautop” and insert the following two lines at the beginning of the function to disable it.

function wpautop($pee, $br = 1) {
        //plyons disabling this. 20090516
        return $pee;

Of course, this change will be undone when you upgrade to a newer WordPress release, so it’s just a convenient hack. Once you have your posts with proper paragraph tags and no extra line feeds, wpautop should not change your markup and therefore you shouldn’t have a problem when it is re-enabled after a WordPress upgrade.

Maritz: 1 – Very Dissatisfied

I bought a new car this fall and a few months later I got a follow-up survey in the mail from Maritz Research. Having a few pieces of feedback to give, such as the orange readout on the Bose sound system being invisible through Sunglasses, I endeavored to fill it out. Holy SAT Test, Batman! The survey is nine jam-packed, small-font pages long. There are 76 officially numbered questions, but many questions involve dozens of individual line-items. See the example below where question 58 asks you to rate 67 individual aspects of the vehicle! Sixty frigging seven! I gave up in frustration long before getting there.

This represents a complete failure to do your job as a market research company. This is their business. Did they exert any effort to make the customer do less work? No. Does the survey include dozens and dozens of line items that completely do not apply to my vehicle because it’s not a pick-up truck, and so forth? Yes. Did they select only the really meaningful things for me to rate? No. For example, I am asked to supply my satisfaction level from 5 “Completely Satisfied” to 1 “Very Dissatisfied” on the topic “absence of engine stalling”. Give me a break. You need to survey you customers to find out A) your cars stall and B) customers find that unsatisfactory. Please. Do they have any section for free-form comments, unprompted feedback, or even brief descriptions? No. Do they have a special “green traffic light” insert stapled in reading “Your Opinion Counts! Pleas Proceed…”? Yes. Apparently my opinion doesn’t count enough for them to create a survey with less complexity than an income tax form. I’m hunting around for the section to fill in my non-farm income.

Please rate your satisfaction with this Maritz Research survey:

5 – Completely Satisfied
4 – Very Satisfied
3 – Satisfied
2 – Somewhat Dissatisfied
1 – Very Dissatisfied

Maritz Survey Fail