I thought that I’d take just a moment to talk about the nature of WordPress when it comes to auto-tagging posts and pages. If you’ve used WordPress for any time, you’ll have some idea of what I’m talking about BUT you may not know how deep this rabbit hole goes.
Let me give you a bit of history first hand. I do a ton of customized sales page coding in WordPress and the nirvana for me is to turn off any auto-tagging in posts what so ever. It can make coding a sales page in HTML for WordPress a real pain if WordPress decides to insert <p></p> or < br /> tags at the most inopportune times.
When you build a post, and if you take a quick peek at the HTML code in a post, you’ll notice a definite lack of these tags, but you will see spaces between paragraphs.
Take a look at this post when I was building it…
So as you can see, no p or br tags, but if you look at the post in the web page, you’ll notice that there are p and br tags inserted.
This is part of the mystifying function built into WordPress called ‘wpautop’. As you can see it stands for ‘wp’ WordPress, ‘auto’, ‘p’. (For more info refer to the WordPress reference page.)
This function handles the heavy lifting of inserting this tags to reduce the complexity in the editor of WordPress. Now, this is great for a majority of WordPress users, but the moment you try to do anything that is off the beaten path, you are immediately in trouble. WordPress will nicely insert these tags where it sees fit. And that can really mess things up.
Now, there’s a ton of plugins that will simply disable this functionality completely. In reality, this situation isn’t very good either. If WordPress doesn’t insert these tags automatically when there isn’t any between paragraphs, you non-customized posts can look pretty bad. But a fellow by the name of Simon has come up with a nifty fix!
You see, if you can keep the <p> tag functionality while turning off the <br> insert functionality, it can go a long way to fixing a lot of problems! Simon has created a plugin to do exactly that. You can see more about it here: http://www.simonbattersby.com/blog/plugin-to-stop-wordpress-adding-br-tags/
To be honest, this is one nifty plugin. I’ve tested it with custom made sales pages in WordPress and it work marvelous!
So you can have your cake and eat it too! Allow WordPress to insert <p> tags when it thinks I needs to but don’t insert <br> tags.
Oh and don’t use the functionality supplied by the plugin TinyMCE Advanced or other that will auto insert these tags for you. It will make a mess of your custom HTML code in a heartbeat.
Do yourself a huge favor and leave this setting that I’m pointing to UNCHECKED!
The only last hurdle is to find a way to insert custom css code onto the page too. But ahhh, that’s another story for another day.
Filed under: Learn Wordpress
Like this post? Subscribe to my RSS feed and get loads more!