The magic_quotes_gpc setting was a PHP feature that automatically escaped quotes in user input. It was removed in PHP 5.4 (2012). If Joomla or another application is showing errors about magic quotes, the fix depends on your PHP version.
magic_quotes no longer exists in modern PHP
If you are running PHP 7.x or 8.x (which all current accounts should be), magic_quotes_gpc does not exist and cannot be enabled or disabled. The error is likely caused by old Joomla code checking for a setting that no longer applies. Update Joomla to resolve it.
01. Joomla 3 and Magic Quotes
Joomla 3 included code that checked for magic quotes and threw warnings if it was enabled. On PHP 5.4+, calling get_magic_quotes_gpc() returns false (PHP 5.4-7.4) or causes a fatal error (PHP 8.0+) because the function was removed entirely.
To fix: update Joomla to the latest version. Joomla 3.10+ and Joomla 4/5 have removed all magic quotes references from their codebase.
02. If You Are on an Older PHP Version
If for some reason you are still running PHP 5.3 or earlier (which we strongly discourage), you can disable magic quotes in .user.ini:
magic_quotes_gpc = Off
But really, you should update your PHP version to at least 8.1. Running PHP 5.x in 2026 is a critical security risk.
Joomla 3 reached end of life in August 2023. If you are still running Joomla 3, migrate to Joomla 4 or 5 as soon as possible. Unsupported CMS versions do not receive security patches and are actively targeted by attackers.
Need Help Updating?
Open a Support TicketQuick Recap
- magic_quotes was removed in PHP 5.4
- Update Joomla to remove the deprecated code
- Update PHP to at least 8.1
- Joomla 3 is end of life - Migrate to Joomla 4/5
- Old PHP versions are a security risk
PHP compatibility · Last updated March 2026 · Browse all PHP Scripts articles
