WordPress Deprecated: Assigning the return value of new by reference is deprecated /home/domainname/wordpress/wp-settings.php on line 512
when we have installed our wordpress we had old php version might be 4 or below php 5. as our server update php 4 to php 5 or more, this error start showing as our wordpress codes are php 4 compatible. so we have 2 options,
1, reinstall new fresh wordpress.
2. use below solution to avoid errors.
I think the better solution you can do the second one.
Solutions
You need to edit two php files,
domainname/wp-settings.php
search this code
if (defined(’WP_DEBUG’) and WP_DEBUG == true) {
error_reporting(E_ALL);
} else {
error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE);
}
Replace with
if (defined(’WP_DEBUG’) and WP_DEBUG == true) {
error_reporting(E_ALL);
} else {
error_reporting(0);
}
now the second file
domainname/wp-config.php
may sure keep a backup of these files before make any change, may be it can stop working your entire website
just add this code at top of this file
error_reporting(0);
save the file and check the website the error will be done.
It’s worked for me 🙂
=====================================================================>