When you are working with an older site it may be necessary to prevent notice level errors from appearing in the error log so that you aren’t swamped with too many messages.
Adding code to wp-config.php doesn’t work because WordPress itself tries to set the error level.
Instead create a ‘must use’ plugin and add the following:
error_reporting(E_ALL & ~E_NOTICE);