I just ran into this situation. Here is a function I used to undo wpautop. I might be missing something, but this is a good start:
function reverse_wpautop($s)
{
//remove any new lines already in there
$s = str_replace("\n", "", $s);
//remove all <p>
$s = str_replace("<p>", "", $s);
//replace <br /> with \n
$s = str_replace(array("<br />", "<br>", "<br/>"), "\n", $s);
//replace </p> with \n\n
$s = str_replace("</p>", "\n\n", $s);
return $s;
}
Related Posts:
- Reusable content block
- TinyMCE strips breaks inside editor
- sharing wp-include – wp-admin on same installation
- WordPress br in content problem
- sortable custom column in media library
- how do I force a single column layout in screen layout
- How to add notification bubble for my custom admin menu page
- How to display the user that published a pending post?
- Making a client area in WordPress – Any good tutorials or plugins?
- Can I rename the wp-admin folder?
- What’s the purpose of admin canonical tag?
- Copy my user account’s wp-admin dashboard layout to other users?
- Set “Display name publicly as” to be usernames by default
- How to disable admin flyout menus?
- How can I set up multi language admin ui?
- How to display multiple custom columns in the wp-admin users.php?
- WordPress custom permalinks not working on OS X localhost
- How to Remove Checkbox for Excerpt Under Screen Options
- How to hide a specific user role option in a user role list?
- Change Dashboard url
- WordPress subdomain wp-admin redirects to main domain
- Remove order field from Page Attributes box
- CDN + WP Admin Query – .htaccess redirection
- Users Unable to Access Dashboard/Posts/Pages
- Disable the administration email address verification (new in 5.3)
- WordPress 3.2 Admin UI Guide
- https://mydomain/wp-admin redirects to wp-login.php?redirect_to=https%3A%2F%2Fmydomain%2Fwp-admin%2F&reauth=1
- Password reset link becomes invalid immediately [closed]
- Get which template being in use within WordPress-admin
- WordPress and bbPress Login conflicts?
- Allow administrators to pick post author on custom post type edit screen
- /wp-admin/ works but website doesn’t load
- How can I use a variable to include a linked image?
- Add css code in admin_enqueue_scripts
- Why isn’t my email showing up as registered with WordPress anymore?
- Unable to locate WordPress Root directory
- Add column to pages table
- redirect to a dedicated sign in page
- 404 redirect wp-login and wp-admin after changing login url [closed]
- Logout USER form backoffice after 30 minutes of inactivity [closed]
- My email address is displaying an email which does not work. What do i do?
- More than one admin logged in?
- How do I let logged out users see the dashboard?
- Downgrade admin account by mistake
- Deploying WordPress for clients – what do they have access to?
- Removing Dashboard Menu Items Through The Database
- load-{$page hook} and returned parameter
- Can’t access wp-admin, redirects to http://%24domain/wp-admin/
- Can log as admin but dashboard missing [closed]
- Making Comments, a sub_menu in admin menu
- Without using wordpress cms Is it possible to signup from my html page
- Customising Word press Admin – Add Post Page functionality to another similar page
- How to allow WordPress updates to only one specific administrator?
- How can I remove commas when adding tags?
- Displaying Title in Title Tag on Edit page?
- GoDaddy hosting wp-admin problem
- Cannot change Connection Information in admin interface
- How can I remove unwanted word on my WP site?
- Add custom fields to a page template, admin side
- Error messages & can’t reach admin after upgrading to 3.4.1 WordPress
- WordPress blog clone.. wp-admin issue
- How to take the help button and link off the dashboard
- Newly created user role not displaying on users screen
- Could not override the url in wp-config file
- How do I fix wp-admin error when exporting reusable blocks?
- issue with wordpress [wp-admin] redirects, when using kubernetes ingress hosting two wordpress websites using path
- Can’t acces login on new site
- WordPress Admin Panel Left Sidebar No showing on Post create page
- WordPress Migration Post Problems
- How to remove the color picker code from users-edit.php
- wp-config.php not affecting my site
- How to prevent spams from admin-ajax.php file?
- After changing Site http to https, can’t access wp login page with a digitalocean hosting
- wp-admin and wp-login.php not Accessible after Cloudflare
- Strange wp-admin problem for all users/adminstrators except the original one?
- Get rendered HTML of Page in Admin Area
- Having SSL enabled on admin, but disabled on post preview and live preview?
- adding existing menu page on new customer user role
- stop customize.php redirect to login page if admin is not logged in
- Strange URLs admin area bug
- Cannot access my wordpress website
- Google flagged a wp-admin redirect as phishing
- Organising and display thousands of photos in media library
- Problem with admin columns
- Checkbox not showing as checked on UserProfile (even with checked=”checked”)
- Get URL of current featured image with JS in edit post view
- Added fields in quick edit screen need to update at the moment
- Custome column sort by date not title
- Block tools menu in wp-admin?
- is_admin() triggers error
- WordPress Admin: open popup window on a custom button
- Modify admin panel tab position
- No HTML/Visual mode option in admin panel (New Post)
- Removing Author name
- No wp-admin, wp-config, or .htaccess folder/file
- Taking over a WordPress site
- WordPress blog fails to open
- wordpress admin is broken [closed]
- LinkControl not showing suggestions when used on admin page
- Cannot Access wp-admin