Home   |   Recommendations   |   Firefox resources   |   TWP Auctions   |   Forum   |   Contact
The Website Professionals

The Website Professionals

Real world webmaster resources.

TWP Auctions - the free eBay script TWP Probe RSS feed Forum
«
»

Stop Wordpress from automatically inserting paragraph tags

Wordpress paragraph tags

By default, Wordpress automatically inserts paragraph tags all over the place when displaying ‘the_content’ – this often gets in the way when you’re trying to space out your text, and also creates validation issues (inserting implicit <p>). If you want to strip the automatically inserted paragraph tags from your content, simply insert this line in your template file above ‘the_content’ tag:
<?php remove_filter (‘the_content’, ‘wpautop’); ?>
Bookmark and Share

Comments

Jason

June 9, 2009

You are a SAINT for posting this.

Thank you!

Steven Johnstone

November 25, 2009

Thank you so much! I spent over five hours searching for answers as to why my perfect XHTML code was failing to validate once included in my WordPress template ‘the_content’ area.

Your one line of code has saved me!

Thanks again
Steven J

Bryan

December 5, 2009

awesome thank you!

Chiefs Hockey

December 17, 2009

U r a freggin saint! Searched for this one liner like crazy. Thank you!

Chiefs Hockey

Phonde

December 28, 2009

This is brilliant! Can’t say how many times i got my validation messed up because of that!
Thanks a lot.

David Tierney

January 6, 2010

Thanks. Sometimes the little things make a big difference.

Ben Carlson

January 20, 2010

How about only removing the tags surrounding images? Any idea on that?

Leave a comment

This is a dofollow website. If you leave a comment, then we'll give you a backlink.
Please be aware that this website is strictly moderated. If you post spam, you'll get a slap.










Featured marketing products for March 2010:
Use a different photo for every cardFree Business Cards Plus 14-Day Free Shipping $50+

Copyright © 2010 The Website Professionals - All rights reserved
Links | Privacy policy