Here’s a simple function that will replace <em> with <i> on your post/page:
function replace_em_with_i($content) {
$content = str_replace('<em>', '<i>', $content);
$content = str_replace('</em>', '</i>', $content);
return $content;
}
add_filter('the_content', 'replace_em_with_i');
Warning: I have tested the code to check if it works (and it does work), but you might want to do some serious testing before using it…
Using a similar function you can replace <strong> with <b>, and so on.
I hope this helps…
Related Posts:
- Forcing reload of editor-style.css
- Hook ‘wp_enqueue_scripts’ priority has no effect
- How can I insert HTML attributes with an existing TinyMCE button?
- Using wp_editor tinyMCE in metabox cause form alert on leaving page
- TinyMCE as comment editor – encoding issues
- Show class from css in format dropdown
- Is there a hook that runs after a user logs in?
- WP Cron Doesn’t Execute When Time Elapses
- Why do some hooks not work inside class context?
- Action hook for custom tax edit
- Is there a limit to hook priority?
- Auto-retrieve YouTube Image for Thumbnail?
- Do WordPress Core Filenames Work as Hooks?
- Tiny MCE editor stripping xlink:href parameter from SVG USE tag
- How to check if which hook triggered the call to a function?
- How do I flush the rules after saving settings using the Settings API?
- Run javascript code after wp_login hook?
- Is it possible to save/modify a post without calling the “save_post” action hook?
- Redirect logged in users if they are on a specific page
- Generating robots.txt dynamically
- Restrict file uploads by extension?
- Hooks are not executing
- Rest API Hook When Post Is Requested
- Best possible way to get all options
- wordpress custom modules/widget areas on the page? can i make my own?
- How to add hook to the_title() and get_the_title()
- Add custom URLs to WordPress’s XML sitemap
- Hooking after get_header()
- How to get post ID in post_updated action hook?
- How can I set status=’publish’ for all featured images?
- Customising the WordPress TinyMce editor and it’s buttons
- Add Item to Custom TinyMCE Menu
- Change Default Font Size and Remove Unwanted Font Sizes in TinyMCE
- Hide content editor for posts after approriate date
- How to send data from a form created by a plugin to an external API?
- How to change the location of admin notice in html without using Javascript?
- Why doesn’t wp_enqueue_script() work when including a JavaScript file with TEMPLATEPATH?
- What are the differences between comment_form_logged_in_after and comment_form_after_fields?
- Detect change to user_meta and retrieve old and new values
- Limiting allowed html elements/strip harmful scripts from editor
- Featured Image Action Hook
- How to find a callback attached to a bbpress hook?
- Event Calendar using insert_post_data after save_post and insert_post after post_transition draft_to_schedule
- How to extend custom (non-core) blocks?
- Different css rules for TinyMCE and Gutenberg while using add_editor_style()
- Hooking into the init action will fire it too frequently?
- Custom TinyMCE style formats disabled
- Is there an earlier hook than login_head or login_enqueue_scripts?
- Implement Hooks Using Array
- What hook is used to display the admin_bar on the front end?
- Dynamically add CSS to the visual editor
- Is there a JavaScript equivalent of get_post_field?
- Inline Style attribute getting stripped off
- Adding a hook to the default (page.php) template
- Add action hook into wp_localize_script
- read more, even if excerpt not trimmed
- Placing tags on wordpress visual editor using shortcodes
- customize tiny MCE blockqute
- How do I prevent term from being created on create_term hook?
- How to distinguish on hook profile_update user registering, user resetting password or user updating profile?
- Hook function prints output twice
- Hook priority in admin with custom plugin
- Embeding style into the header via the function.php
- ‘save_post’ hook not working in WP 3.5
- Change the Default Plugin page filter to Active intead of All
- How to execute a hook asynchronously?
- Issues with if, else, and elseif statements
- Is there a before_save_post hook or something similar
- “Seen by” Feature in posts [closed]
- How to hook in to the “output buffer” and add html content
- hook for loading page
- What hook to use to redirect based on $post
- How can I modify the header of RSS feed items?
- Print results of a WP_Query to wp-admin/upload.php within ‘delete_attachment’ hook?
- upgrader_process_complete filter not fired using ajax updates
- How to debug wordpress hooked functions?
- remove_action(‘save_post’) in function that was triggered by save post not working
- How to get template name or category before publish
- WordPress How to reorder Page/Post Settings
- Is there a way to Insert a post to post list?
- “Intercept” enqueing of 3rd party’s JS file
- WP hook to add custom content after the_title()
- How can I add a stylesheet to the Classic Editor page?
- wp_get_current_user Not working
- Display custom debug info inside page and not before head
- calculate values from a field and insert them into custom fields when publishing or updating post
- theme functions (hooks)
- frontend show edit profile with selected custom options
- How to change Akismet commenter privacy notice?
- How To Apply Different Styles To All Blocks Based on Post Meta Value?
- change position of element using hook [closed]
- The acction hook stop working if i move it from plugin file to theme’s functions.php file
- How can I add new attributes in a Class when my addon is active?
- add_action failed to display function by a plugin
- Hook on opening a media/document
- Looking for a way to insert PDF image preview in TinyMCE
- ‘At a Glance’ dashboard: combining infos
- Getting fatal error when using manage_media_columns filter of WordPress
- Why is TinyMCE 4.x not using updated CSS even with forced reload? [closed]
- Why does the “visual editor” add useless html-comments and how can I get rid of them?