WordPress: Coding it sucks

There is a problem in WordPress – actually if you look around far enough there are a number of them, however for now I want to pick on one in particular.

I’ve been pushing and shoving and sculpting wordpress over the past few days to try and make it perform like a CMS – which is actually really easy provided you don’t have anything complex in your layout. I thought “Sweet, WordPress lets me publish code – you know good ol’ fashioned HTML”.

Well … kinda. See the problem is WordPress likes to try and help you out by running your code through a function called wpautop – which kinda tries to wrap your code in <p> and <br /> tags. This is cool and all when you are using the Visual editor – but whoo boy does it suck when you are entering code.

First of all it changes ALL <div>’s into <p>’s and when you have nested <div>’s well, nested <p>’s don’t really work.
Next it tries to add extra padding and <br />’s to things, and well it just shouldn’t.
Finally, because there is no “Post Class” in WordPress (there is a real lack of OOP development happening in this project) you can’t write a class file for your theme to extend & therefore override the default functions.

WORDPRESS you SUCK!!! I still love you, and I still use you to power many of my sites, but you SUCK.

Please, Automattic, if you are listening – please allow us more flexibility to override your default functions – or maybe, just maybe, let us actually post REAL html through the CODE editor!

Other posts you might enjoy

  1. WordPress sucks – but I still love it
  2. A better WordPress
  3. tumblr + studiowhiz
  4. 3 Steps to saving $519 on Software
  5. Making the most of your online time

11 Comments to “WordPress: Coding it sucks”

  1. dcw 25 February 2008 at 7:40 pm #

    Try the FCK editor plugin. It’s a bit bulky but it’s much more friendly to your complex posts that include tags.

    http://www.deanlee.cn/wordpress/fckeditor-for-wordpress-plugin/

  2. Matt 25 February 2008 at 8:54 pm #

    I think there might be some confusion here.

    Autop doesn’t change Ps to DIVs, maybe it was the WYSIWYG that did that?

    You can extend, remove, and add filters using the filter system, which all posts go through. There are plugins that disable autop and texturize, it only takes two lines.

    But before you do that, would love to track down the bugs that you’re running into. The P to DIV thing I believe is already fixed in 2.5 beta by the new WYSIWYG, but not sure what you mean by the others.

  3. kaeo 25 February 2008 at 9:38 pm #

    amen.

  4. Miriam 25 February 2008 at 9:45 pm #

    I’m with you. I love WordPress, but it SO annoying when you write something in the code editor, only to find it all changed in the visual editor. It drives me crazy!

  5. Mr K 26 February 2008 at 6:59 am #

    @ Matt, Yeah it’s not turning P into DIV, it’s turning DIV into P – which is just as bad. I’ve looked at extending the filter system – but I’m yet to see that without hacking the core. Care to point me to a URL? All the posts etc I’ve seen online point you to changing the filters in the wpautop function. Because wpautop is a general function and not part of a class, I can’t write an override for it. If I go hack the core, next release will see it being reverted.

    If the 2.5beta is available let me know, I’d love to run it through some tests – and write a review here. I’ve seen the demo site but really haven’t had a chance to test it. (I have another site I’m throwing together so it’d be a great place to trial 2.5)

    I think you guys are doing a great job, and I thank you for dropping by. I know there is a lot of angst out there around the code editor so to see it improved in 2.5 would be awesome!!

  6. Mr K 26 February 2008 at 7:00 am #

    Oh and one last thing, I don’t want to disable Autop – I still need it for when editing in Visual mode – ie: blog posting

  7. Damascus 5 March 2008 at 5:56 am #

    Heck, I can’t even work out how to change my gravatar yet!

    %:/

  8. Mr K 5 March 2008 at 9:35 am #

    go to http://www.gravatar.com … login with the email you use and away you go :)

  9. Dan 18 April 2008 at 3:32 am #

    I totally agree… worst thing about wordpress.

  10. Dan 18 April 2008 at 5:24 am #

    Just found a fix for it… a plug-in called WP Unformatted. It’s cool, you can just specify which pages or posts you don’t want to autoformat. Just read the README that’s included with the download for a how-to. :)

    WP Unformatted
    http://alexking.org/projects/wordpress

  11. paper shredder 25 July 2008 at 10:03 pm #

    WordPress: Coding it sucks