Web Design | SEO | Website Development

Search Engine Optimisation, Magento & Wordpress Specialist [Cranleigh | Surrey]

Fixing retina.js 404 console errors on wordpress

By In Advice, Platforms, Website Development On 07/08/2018

Many WordPress themes use retina.js which changes small “lower quality” images with “retina” images (which are twice as large but squeezed down so that they are higher def for modern high res screens).

I have seen on several WordPress sites that retina.js gives a 404 for every “retina” image which can’t be found.

After a bit of messing around, I decided to remove it as, to be honest, it isn’t really necessary and in these cases was causing more problems than it solved.

As I wanted to maintain the parent themes updatability I added the following code to the child themes functions file to remove the relevant retina.js file from WordPress.

function dequeue_retina_script() {
add_action( 'wp_enqueue_scripts', 'dequeue_retina_script', 20 );

About the Author

Dan Vince

Yet another Web Development Professional

Related Posts

Leave a comment