WP_Widget deprecated error in WordPress V4.3

This error only happened this morning as I updated my wordpress site to version 4.3. Two other sites on the same hosting ( and all using CPanel as an admin portal for the hosting) are not having any problem. On this one problematic site company.com though on the wordpress admin portal and the live site there is an error repeating several times at the top of the page, that is:

The error continues down the page like this 9 times.

The error page is then finished off with this error/line.

I have read up today on this and it is perhaps to do with upgrading from PHP4 to PHP5, although there is no problem with the other WP sites on the same server. I also disabled all the plugins on the site to test and the problem was still there. Short of restoring from a backup (which is not easy to do and can cause errors of its own) is there anyone else having this issue today/recently?

It does not help that the error message appears to suggest a solution itself before it is cut off at the end with

Use…”. The error message begins “company/public_html/wp-includes/ …”. The second line is “constructor method for WP_Widget is deprecated since version 4.3.0.

Version 4.3 is the version that WP was updated to today. It seemingly has caused this error but I do not know how to fix it.

Any other information needed to answer this I’ll be more than happy to provide.

6 s
6

The error isn’t actually caused by your PHP version (PHP 4 constructors won’t be removed until PHP 7) – it’s a warning produced by WordPress in preparation for this. Each repetition of the error represents a plugin using the outdated code.

Until your plugins’ authors update them, you can run the following shell command on a Linux system to find the old constructor calls:

grep -R "WP_Widget\(" /path/to/your/wp/install

This will give you a list of files that you can either modify on the command line, or use WP’s plugin editor. Matched strings – mostly parent::WP_Widget(args) should be changed to parent::__construct(args).

Leave a Comment