admin管理员组

文章数量:1122832

I have the old problem that the WordPress editor overwrites my HTML code. For example, the editor inserts <p> and <br> tags where you don't have them set.

The second problem is the editor doesn't show the real source code. If I write some code in the editor, and update, and look afterwards at the source code in the front-end (e.g. with Firefox), it shows there are tags which I can't see in the back-end editor.

To suppress the problem, I installed the TinyMCE A. Editor, but it doesn't always work. Why must I have an external editor to change it? Can't WordPress have it's own solution for this little bug?

I wish that WordPress would have the option to switch the Editor ON or OFF, so the user can choose. Some kind of solution might be a supplement in functions.php, where you can add shortcodes; I think that is laborious, but could it be the real solution?

I have the old problem that the WordPress editor overwrites my HTML code. For example, the editor inserts <p> and <br> tags where you don't have them set.

The second problem is the editor doesn't show the real source code. If I write some code in the editor, and update, and look afterwards at the source code in the front-end (e.g. with Firefox), it shows there are tags which I can't see in the back-end editor.

To suppress the problem, I installed the TinyMCE A. Editor, but it doesn't always work. Why must I have an external editor to change it? Can't WordPress have it's own solution for this little bug?

I wish that WordPress would have the option to switch the Editor ON or OFF, so the user can choose. Some kind of solution might be a supplement in functions.php, where you can add shortcodes; I think that is laborious, but could it be the real solution?

Share Improve this question edited Sep 15, 2015 at 1:05 Gabriel 2,24810 gold badges22 silver badges24 bronze badges asked Oct 15, 2014 at 12:04 footerfooter 12 bronze badges 2
  • Have you looked at this plugin?: wordpress.org/plugins/disable-visual-editor-wysiwyg – John Reid Commented Oct 15, 2014 at 12:18
  • Thank you for answer.. but thats not my solution, I need the function visual editor too.. Only no overwrite!? :) – footer Commented Oct 15, 2014 at 12:28
Add a comment  | 

1 Answer 1

Reset to default 0

If you were always writing in HTML, you could add the following to your functions.php file:

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

I do this for some of my own sites.

As it sounds like you want the option to turn this on or off, you may want to try the wpautop control plugin.

This should let you turn it off on your posts, while leaving it on for other users.

本文标签: How to stop wpeditor() overwriting my HTML