wp-content » plugins » How to fix Call to undefined function get_magic_quotes_gpc() in WordPress ✔️

How to fix Call to undefined function get_magic_quotes_gpc() in WordPress ✔️

Magic Quotes is a PHP function where strings are automatically escaped (special characters are prefixed with a backslash) before being passed. This is considered a bad practice and as of PHP 7.4, they are deprecated.

This article by Sebastian Bergmann explains in detail Why Magic Quotes are gone in PHP 7

WordPress doesn’t use magic quotes, so if you experience a Call to undefined function get_magic_quotes_gpc() error in WordPress it is caused by either your active theme or plugins.

So, you can either disable the plugin that is using this unsafe function and use an alternative WordPress plugin.

Or, revert the PHP version to PHP 7.4 or older, where this function is still used.

See also  WP-CLI Not Working: Call to undefined function exec()

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended