I have problem in Wordpress after migrating my website.
In title tag (
<title>) I have
For the browser it's good, in the title it shows good.
But in html code is
Please help me <3
WordPress converts normal dash (-) to long dash (
–), straight quotes to curly quotes and some other similar symbols and punctuations to their printer friendly versions using
Generally it's recommended to leave them up to WordPress. However, occasionally, we may want to override this behaviour. For example, in case we are writing Programming CODE or command and want people to copy paste them.
One way to avoid this conversion is to have these CODE inside
<code></code> block. That way WordPress will know that they are meant to be kept as is. However, we may have already written it and don't want a rewrite. In that case, it's possible to stop WordPress to do these auto conversions all together by disabling
For WordPress 4.0 and above, it's easy to do using the following CODE in a plugin or your theme's
add_filter( 'run_wptexturize', '__return_false' );
For before WordPress 4.0, you'll need a little more CODE:
foreach( array( 'bloginfo', 'the_content', 'the_excerpt', 'the_title', 'comment_text', 'comment_author', 'link_name', 'link_description', 'link_notes', 'list_cats', 'nav_menu_attr_title', 'nav_menu_description', 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'term_description', 'term_name', 'widget_title', 'wp_title' ) as $texturize_disable_for ) remove_filter( $texturize_disable_for, 'wptexturize' );
Of course, you may choose to disable
wptexturize only for part of your content. Say, to disable only for
title, you may use:
remove_filter( 'the_title', 'wptexturize' );
Make sure that anything you are passing to the
wp_title(); function is wrapped in
<title><?php esc_html(wp_title($YOURSTRINGHERE)); ?></title>
This will properly convert any HTML entities to their appropriate equivalents.