WordPress.org

Ready to get started?Download WordPress

Forums

How to stop WordPress raping my HTML? (3 posts)

  1. bensheffield
    Member
    Posted 3 years ago #

    Every time I go from HTML to visual view, WordPress keeps changing my code on me. Removing line breaks, turning center tags into CSS text-aligns (which don't work), etc etc. It's very frustrating.

    Is there some way I can disable these dubious "auto-corrections"?

  2. Darrell Schauss
    Member
    Posted 3 years ago #

    Is it a custom theme you may be missing the basic CSS that applies to the editors alignments.

    http://pastebin.com/raw.php?i=1ApFGJwD (taken from TwentyTen theme, assumes you have a #content ID. otherwise change/remove it in CSS)

    As for line breaks TinyMCE Advanced has option to stop removing line breaks and paragraph tags in addition to providing more editor buttons/features.

    http://wordpress.org/extend/plugins/tinymce-advanced/

  3. traag1
    Member
    Posted 3 years ago #

    Actually the problem is that whenever you switch back to Visual mode, whatever code WordPress doesn't like is removed or changed. It is easily one of the most annoying features of WordPress if you like to embed videos, or really anything that uses anything but the most basic HTML. At the very least, it should have an option to turn this feature off, but it doesn't.

    So I am totally with you, for a site that claims "Code is Poetry", this sort of code Nazism is completely ridiculous, and saying "Well just don't use Visual mode" is not an acceptable alternative.

    and @Darrell: This problem has absolutely NOTHING to do with what theme you are using, what CSS is in that theme, or TinyMCE.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.