Title: dev-notes-7-2 – Make WordPress Core

---

#  Tag Archives: dev-notes-7-2

 [  ](https://profiles.wordpress.org/tyxla/) [Marin Atanasov](https://profiles.wordpress.org/tyxla/)
6:13 pm _on_ October 9, 2026     
Tags: [7.2 ( 20 )](https://make.wordpress.org/core/tag/7-2/),
[database ( 7 )](https://make.wordpress.org/core/tag/database/), [dev-notes ( 648 )](https://make.wordpress.org/core/tag/dev-notes/),
dev-notes-7-2   

# 󠀁[NO_BACKSLASH_ESCAPES SQL mode is now turned off by default in WordPress 7.2](https://make.wordpress.org/core/2026/10/09/no_backslash_escapes-sql-mode-is-now-turned-off-by-default-in-wordpress-7-2/)󠁿

WordPress 7.2 adds `NO_BACKSLASH_ESCAPES` to the list of SQL modes that WordPress
doesn’t support. WordPress already turns off some modes, such as `STRICT_ALL_TABLES`,`
TRADITIONAL` and `ANSI`, when it connects to the database. This mode is now on that
list too.

## Why this change?

WordPress uses the backslash character (`\`) to escape special characters in SQL
queries. When `NO_BACKSLASH_ESCAPES` is on, MySQLMySQL MySQL is a relational database
management system. A database is a structured collection of data where content, 
configuration and other options are stored. [https://www.mysql.com](https://www.mysql.com/)
reads the backslash as a normal character, not as an escape character. Queries with
escaped values can then fail or return the wrong data.

Some hosts or server setups may turn this mode on. Before this change, sites on 
those servers could have hard-to-find database problems.

For more details, see [Ticket #66185](https://core.trac.wordpress.org/ticket/66185).

## What changes?

When WordPress connects to the database, `wpdb::set_sql_mode()` now removes `NO_BACKSLASH_ESCAPES`
from the session’s SQL modes. This affects only the WordPress database connection.
It doesn’t change the server’s global settings.

Most sites won’t notice any difference.

## What if I need this mode?

If your site really needs `NO_BACKSLASH_ESCAPES`, you can keep it with the existing`
incompatible_sql_modes` filterFilter Filters are one of the two types of Hooks [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
They provide a way for functions to modify data of other functions. They are the
counterpart to Actions. Unlike Actions, filters are meant to work in an isolated
manner, and should never have side effects such as affecting global variables and
output.:

    ```notranslate
    add_filter( 'incompatible_sql_modes', function ( $modes ) {
    	return array_diff( $modes, array( 'NO_BACKSLASH_ESCAPES' ) );
    } );
    ```

WordPress connects to the database before plugins load, so add this code in a `db.
php` drop-in. Code in a normal pluginPlugin A plugin is a piece of software containing
a group of functions that can be added to a WordPress website. They can extend functionality
or add new features to your WordPress websites. WordPress plugins are written in
the PHP programming language and integrate seamlessly with WordPress. These can 
be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
or can be cost-based plugin from a third-party. or a must-use plugin runs too late.

Please note that WordPress CoreCore Core is the set of software required to run 
WordPress. The Core Development Team builds WordPress. may not work correctly with
this mode turned on.

Props to [@mcsf](https://profiles.wordpress.org/mcsf/) for reviewing this post.

[#7-2](https://make.wordpress.org/core/tag/7-2/), [#dev-notes](https://make.wordpress.org/core/tag/dev-notes/),
[#dev-notes-7-2](https://make.wordpress.org/core/tag/dev-notes-7-2/), [#database](https://make.wordpress.org/core/tag/database/)

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcore%2F2026%2F10%2F09%2Fno_backslash_escapes-sql-mode-is-now-turned-off-by-default-in-wordpress-7-2%2F%23respond&locale=en_US)