My writer has a tendency to add extra newlines (Enter key) and spaces (space bar) at the ends of posts. Sometimes this results in inches of extra whitespace onscreen!

Is there a way I can make sure extra trailing whitespace is removed when he hits “Update” in the WordPress post editor?

4 Answers
4

Quick guess would be:

add_filter('content_save_pre', 'trim');

Add to functions.php of theme or wherever is appropriate in your site.

Leave a Reply

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