[Share] How to stop WordPress convert straight quotation marks to curvy quotation marks
By default, WordPress will convert your straight quotation marks into curvy quotation marks (Smart Quotes or left/right quotes). This function makes the quote marks much prettier than straight quotes, but they have a fundamental problem. When someone tries to cite your blog post or if you are posting a code snippet, the curvy quotes will cause errors and not display correctly as they are pasted into the new system, social media site or CMS/blog.
Here is an example, when I add this script into the post content in backend wp-admin:
Then I go to the post in frontend, here is what the displayed:
You can see, WordPress auto convert all straight quotation marks to curvy quotation marks.
To remove the curvy (smart quotes) from your WordPress post content, paste the following PHP snippet at the end of your functions.php page in your theme folder. Please note: we tested this on a few themes and noticed that this can cause errors with certain functions.php files that have been modified. Simply make a backup of your original file prior to trying this out.
Please the code at the end of your functions.php page:
<?php remove_filter('the_content', 'wptexturize'); ?>
You can also remove the curvy quotations from titles by adding this code:
<?php remove_filter('the_title', 'wptexturize'); ?>
If you do not want to edit your functions.php file, you can use this plugin: wpuntexturize
I hope this will help you!
Reference source: Ironpaper