Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

WordPress may have a text editor that appears to be WYSIWYG, but upon using it I discovered that it is actually WYSIWYMG- What You See Is What You Might Get (once it's done screwing with the HTML).

Isn't there a way to tell it to do nothing with the text you put into it? Just leave it as it is. No optimizations, no trying to guess what I meant, no correcting my HTML, no converting whitespace into nbsp's that for some reason cause line breaks, no changing the formatting or the spacing between embedded objects after you edit it to fix one typo...

I did try searching the settings area but found only one HTML related option (regarding matching closing tags).

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

After you post your content, WordPress will pass the_content() function through a number of filtering function's. There are four of them, wptexturize(), convert_smilies(), convert_chars(), and wpautop(). All of these are defined in wp-includes/formatting.php and are referenced in wp-includes/default-filters.php.

To remove these filtering functions you can disable them by putting this in your functions.php theme file:

remove_filter('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');
remove_filter('the_content', 'convert_smilies');
remove_filter('the_content', 'convert_chars');

That should remove all formatting between what you save in TinyMCE (the WYSIWYG editor) and the front end view of your website. For more reference on what each of these does refer to the codex.

I hope this helps, best of luck!

share|improve this answer
    
How do I access that file? –  EpsilonVector Nov 7 '10 at 10:28
    
If you mean the functions.php file you can do it 2 ways: FTP into your WordPress site and browse to "wp-content/themes/{theme-name}/functions.php". Open and edit that file. Another way is using the Theme editor in WordPress, which is at my.wordpresssite.com/wp-admin/theme-editor.php. From there opne the "Theme Functions" file and add the code there. –  Kevin Leary Nov 7 '10 at 15:33
1  
Also, be cautious when removing these filters. They can cause some issues with output but also do wonders for formatting content. For more info refer to this article in the codex: codex.wordpress.org/How_WordPress_Processes_Post_Content –  Kevin Leary Nov 7 '10 at 15:36
    
Thanks! 8) was showing up as a smilie with sunglasses - very frustrating. –  NealWalters Jan 28 '11 at 4:53
    
Actually, better to turn off smilies from Dashboard - Settings / Writing as the link you provided suggests. –  NealWalters Jan 28 '11 at 4:59
add comment

for adding php some php plugins exist...and additional plugins that make the plugins work via e.g. WYSIWYG posting via the XMLRPC interface... and if you really get desperate in a wp mu environment, you can always put your content in by reading a database record, replacing the content and rewriting the record to the external database... (e.g. if in the revision structure someone with more rights initially created the record (see comments on http://bluesome.net/post/2005/08/18/50/))

See also this question: Line breaks not showing up properly

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.