How to disable smart quotes in WordPress

WordPress auto corrects Straight Quotes (single and double) to Curly or Smart Quotes. Although it looks good and typographically correct, but it doesn't work when used as Programming CODE or Commands.

We can resolve this by installing a wordpress plugin created by ''".

Step-1: Create a new file called disable-smart-quotes.php and use the following CODE:

Plugin Name: Disable Smart Quotes
Plugin URI:
Description:  WordPress Plugin to Disable auto Smart (Curly) quote conversion
Version: 1.0
Author:  Fayaz Ahmed
Author URI:
if( version_compare ( $wp_version, '4.0' ) === -1 ) {
    // To Disable Smart Quotes for WordPress less than 4.0
    foreach( array(
    ) as $sQuote_disable_for )
    remove_filter( $sQuote_disable_for, 'wptexturize' );
else {
    // To Disable Smart Quotes for WordPress 4.0 or higher
    add_filter( 'run_wptexturize', '__return_false' );

Step-2: Then upload this file to the following directory:


Step-3: Then, login to your WordPress Admin Panel from Your_WordPress_URL/wp-admin/ » go to Plugins menu » activate this new plugin named Disable Smart Quotes

At this point, your WordPress Smart Quotes are Disabled and WordPress will no linger automatically convert straight (single or double) quotes into curly (single or double) quotes or smart quotes.

Once again thanks to "" for the wonderfull plugin.

Leave a Reply