Wordpress Deprecated: Assigning the return value of new by reference is deprecated


2 Votes, Rating: 51 Star2 Stars3 Stars4 Stars5 Stars

WordPress Deprecated: Assigning the return value of new by reference is deprecated /home/root/wordpress/wp-settings.php on line 512

These days i have seen many wordpress blog sites showing this sort of error, even google have indexed many domain pages with this error looks very funny icon smile Wordpress Deprecated: Assigning the return value of new by reference is deprecated

web owner search this error solution online, even few days back our website also showing same error, and i have to find out solution to fix it too.

Here i have bring you fast and exact solution read below and fix it.

Why this happened suddenly ?

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 2 solution is better as no body want to have huge pain to install new fresh copy, or loss data.

so why waiting for here is the solution.

Solutions

You need to edit 2 php files,

root/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 2nd file

root/wp-config.php

may sure keep a back of this file before make any change, it can stop working your entire website

just add this code at top of this file

error_reporting(0);

that is it.

Share/Save/Bookmark

3 Responses to “Wordpress Deprecated: Assigning the return value of new by reference is deprecated”

  1. Charles says:

    Will wordpress have an update for this pretty soon?

  2. 1 says:

    I do everything and site is down

  3. Luke says:

    Solved my problem. Huge!
    Thanks a lot.

Leave a Reply