How To

Hide The Old Image Paths with WP Ghost

Before hiding the images with old paths, it’s essential to understand what this process entails and what the risks involved.

Given that images don’t represent a security risk for your site, hiding them is not a necessity or something we recommend to increase your WordPress site’s protection.

From an SEO standpoint, if Google has already indexed the images, when someone lands on your site via Google Images, they will see a 404 Page Not Found error.

Even if you don’t use WP Ghost to hide images, over time, Google will index all media images with the new paths without affecting SEO.

However, if you still wish to hide the images with the old paths, follow the steps below:

Hide Old Image Paths

You can set the extension files you want to hide on the old paths from WP Ghost > Change Paths > WP Core Security > Hide WordPress Common Paths.

The image extensions that are included in the list are: jpeg, jpg, tiff, gif, bmp, png, webp.

define('HMW_HIDE_OLD_IMAGES', true);

and you will see the IMAGE files option in the Hide File Extensions list:

Select the IMAGE files and save the settings.

Redirect Images From the Old Paths to the New Paths

It is recommended that the same image not be used on two different URLs on a website to avoid duplicate content issues and maintain good search engine optimization (SEO) practices.

When search engines like Google detect duplicate content, it can negatively impact the website’s visibility and rankings in search results.

Select the MEDIA Files from WP Ghost > Change Paths > Hide WordPress Common Path > Hide File Extensions extension list.

By implementing this solution, any requests for images in the old /wp-content/uploads/ the directory will be redirected to the new /storage/ directory, preventing duplicate URLs for the same image.

Troubleshooting

If your theme or other plugins load images into CSS or JS, it’s possible for images to not load in the front end. A solution for this is using a cache plugin and activating the option to modify the paths in cache files using WP Ghost.

John Darrel

Change Database Prefix in WordPress

Because hackers often use bots to search for security flaws in your website, it is…

12 months

Customize WordPress Uploads Directory

The easiest way to change the default media uploads path is to use the WP…

12 months

WP Ghost and WP Rocket Cache

To hide all CSS and JS you need to follow the steps to Combine the…

12 months

Why is website security important?

https://youtu.be/6ylhojSi-_E In this video, we’ll explore why website security matters and what can happen if…

12 months

Is WordPress Website Easily Hacked?

The security of your WordPress site depends on multiple factors, such as the strength of…

12 months

Setting up Two-Factor Authentication (2FA) for WordPress Using Mobile Apps

When you enable two-factor authentication (2FA) for your WordPress website, it adds an extra layer…

12 months