How to create a proper Wordpress(php) 404 fallback for not found images. The JS approach is not suitable because SEO Auditors parse only html, and there are still 404 errors https://prnt.sc/vha4og .
So please do not suggest codes like these - it doesn't resolve the issue :
<img src="<?php echo esc_url( $catalog_thumb_image['url'] ); ?>" onerror="this.src='https://site.md/wp-content/uploads/2018/07/logo.png'" alt="<?php esc_attr( the_title() ); ?>">
Or via jquery
$('img').on('error', function() {
$(this).attr('src', 'https://site.md/wp-content/uploads/2018/07/logo.png');
});