It is enough to add unfiltered_html
capability to Editor
role.
Add the following code into your current theme’s functions.php
:
function wpse_change_capability() {
$role = get_role( 'editor' );
if ( ! $role->has_cap( 'unfiltered_html' ) )
$role->add_cap( 'unfiltered_html' );
}
add_action( 'init', 'wpse_change_capability', 10 );
Login as the user with Editor
role. Test it by editing any post / page. HTML markup will be preserved. Remove the code above from functions.php
.
If you decide to remove unfiltered_html
capability from Editor
role, repeat steps described above, using this code:
function wpse_change_capability() {
$role = get_role( 'editor' );
if ( $role->has_cap( 'unfiltered_html' ) )
$role->remove_cap( 'unfiltered_html' );
}
add_action( 'init', 'wpse_change_capability', 10 );
Related Posts:
- How to retain HTML5 Attributes on Markup
- Remove “minor-publishing” div from Publish admin metabox
- how to know if admin is in edit page or post [duplicate]
- Admin: very slow edit page caused by core meta query
- Editor Styles and Typekit
- Styling Shortcodes in Visual Editor
- WordPress admin screen very slow / timing out when editing or adding a new page/custom post
- How do I set up a webhook?
- Adding custom Javascript to the head tag in Admin
- Integrate post tags in Post Edit page with qTranslate
- Change post title during post saving process
- Custom taxonomy admin description
- user-new.php less detailed after WP3.1; how to revert?
- Disable HTML (Text) Tab in Post Editor
- How to restrict the editors from viewing/editing pages created by admin?
- How to set default editor tab
- Make the Status, Visibility, or Date fields opened by default in the Publish box
- How do you set up a WordPress blog with multiple authors to allow something like StackExchange’s “community wiki” feature?
- Editors change a permalink on an unpublished post, but only admins change a permalink on a post that has ever been published?
- Change default italic from to in admin editor
- WordPress 3.1’s admin bar disappears only leaving its 28 px padding (in ubuntu)!
- Hide post title input for all roles except admin
- Post editor is 89953px tall. How to fix?
- Function to add custom HTML into head in custom post-type list page
- Weird jquery problem when upgrade to WordPress 3.1
- Gutenberg UI has changed
- Can I retrieve Published changes when changes have been Saved but not Published in WordPress Semplice?
- Disabling “View” mentions from backend?
- TinyMCE buttons broken
- Background image in login showing in admin area
- WordPress 4.5 Inline Link Toolbar not working on custom wp_editor instance
- What Role to assign remote site developer?
- CSS Styles specific to Admin Sidebar not loading
- Where in WP can I check history or log of updates of plugins etc?
- How does admin-ajax.php work?
- Can an admin check passwords of registered users?
- Prevent author from changing their posts if admin has modified
- Showing WP_Error message with admin_notice action hook
- Set Featured Image programmatically (in admin) with JavaScript?
- Custom order of terms for custom taxonomy in admin and website
- Can I set a default dashboard layout for all users?
- Change admin startpage to Pages-page?
- How to remove “Super Admin” from All Users for those that are not a “Super Admin”?
- Customize the upload screen
- How to maintain wordpress site blogs in production and staging?
- WordPress redirects me to homepage after page update in admin section
- how to display “Edit | Quick Edit | Trash | View” in custom WP_List_Table column?
- How to publish page that can’t be detected by search engines?
- Custom taxonomy admin page
- How can I activate Collapse Menu in WordPress?
- Help extending custom drag-drop page ordering on admin page list screen
- Change the Default Pages Menu View in wp-admin
- In administration, how do I display comments of a certain user?
- New users must comment when requesting username
- WordPress stripping html and script tags from some admin users on save
- Why are my styles being applied to the admin area?
- Disable WP Editor for specific page templates
- How to change admin menu position of “Media”?
- How to disable automatic excerpt generation *in admin*?
- Hide Updates from Admins that don’t equal a set Username
- Adding all sub-pages to the menu manager
- wp_schedule_event only when admin is visited
- Single category’s posts list in admin menu
- Hide Pages on Edit Pages based on Capability (edit_others_pages)?
- Hide one admin from another admin
- Hard-coding custom menu elements for menu manager
- How to add custom classes to admin list table default rows or columns?
- How to hide a specific part of dashboard for non-admin roles?
- Get a listing of portfolio items and categories
- WordPress Remove Submenus
- Continuous Login Sessions For Super Admins Across Multi-Site Network of Sites
- using rewrites to secure login page
- page not updating with database
- Client system for media review?
- Redirect from the dashboard to edit.php if wp_is_mobile() is true
- Create a WordPress administrator without access to back-end
- How to log out from admin or front-end only?
- Shared account / dual blogging in WordPress
- How To Make Iris Color Picker Showed Up Over Form and Text?
- my checkbox is not saving it’s value
- Can’t login to my admin area
- how to show admin notice in custom menu page after submitting the form?
- Accidentally changed website url
- How much traffic is real traffic?
- How to change the descriptive text on the menus admin page?
- Call require_once form admin page with checkbox
- How To Remove Import/Export Option From Tools?
- How to create custom backend admin menu in different languages?
- Unable to access admin web page
- Error “Sorry, you are not allowed to access this page”
- Create WordPress Menu Item Without Linking to a Custom Page
- Search Only Works when Logged into Admin
- exclude ID on avatar
- Different role for free and pro users in wordpress without using bbpress
- WordPress login not working
- Enqueue script throws error in console
- Calculate and save an average in a meta
- If the only thing I use MySQL for is WordPress, do I need MySQL’s timezone tables?
- My Account Lost Administrator permission
- Use the wordpress admin table