Make WordPress Core

Opened 6 years ago

Closed 4 years ago

#43486 closed feature request (worksforme)

The Problem with HTML and wpautop

Reported by: jim5471's profile jim5471 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: TinyMCE Keywords:
Focuses: Cc:


Most editors use the VISUAL mode in The TinyMCE editor but there are a minority of editors who use the TEXT mode.

The TEXT mode allows editors to input raw HTML code.

If they program in HTML4 then wpautop reformats the code and sometimes introduces paragraph errors.

HTML5 is a greater problem and should be avoided.

wpautop can be turned off but this is not a realistic solution in a multi-user situation.

I would like to propose this easy modification as a possible solution.

  1. Editors who want to turn off wpautop should insert "[WPAUTOP-OFF]" at the top of their script.
  1. wp-includes/formatting.php should be changed with this additional code
LINE  439   function wpautop( $pee, $br = true ) {
	 * If "[WPAUTOP-OFF]" is present in $pee then 
	 * return $pee with "[WPAUTOP-OFF]" removed and no other changes
	if ( false !== strpos( $pee, "[WPAUTOP-OFF]" ) ) { 
		$pee = str_replace("[WPAUTOP-OFF]", "", $pee);
		return $pee; }

Change History (4)

#1 follow-up: @SergeyBiryukov
6 years ago

Hi @jim5471, welcome to WordPress Trac! Thanks for the ticket.

There are plugins like Raw HTML that might be helpful.

#2 in reply to: ↑ 1 @jim5471
6 years ago

Replying to SergeyBiryukov:

There are plugins like Raw HTML that might be helpful.

Thanks Sergey - I hadn't seen that before - number of users shows the scale of the issue

#3 @pento
5 years ago

  • Version trunk deleted

#4 @azaozz
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

This is now superseded by the block editor. It still uses wpautop sometimes in classic blocks, but hoping this can be fixed completely.

Closing as worksforme as wpautop can be (easily) disabled by plugins and is not used in the block editor.

Note: See TracTickets for help on using tickets.