Applicable to:
- Plesk for Linux
Symptoms
-
WordPress Toolkit Hotlinking Protection is enabled on the WordPress instance. Going to Domains > example.com > WordPress instance > Check Security > Hotlink protection is enabled.
-
A caching mechanism is enabled. I.E.: native WordPress plugins, memcached, Google PageSpeed Insights, etc.
-
An image is uploaded into
httpdocs/wp-content/uploads
folder path: -
However, accessing directly the image from
httpdocs/wp-content/uploads
folder shows the Hotlinking Protection image instead of the original file:
Cause
Cached files are loaded instead of the original files.
This is WordPress Toolkit extension bug #EXTWPTOOLK-2675 which will be fixed in future updates.
Resolution
As a workaround, disable Hotlinking Protection:
-
Go to Domains > example.com > WordPress Instance > Check Security > Disable Hotlink protection
-
Disable/uninstall any caching mechanism enabled and present for the WordPress website (I.E.: WordPress plugins, memcached, Google PageSpeed Insights, etc).
Note: in some cases disabling all WordPress plugins and then re-activating both plugins and Hotlink protection fixes the issue.
Comments
6 comments
Unfortunately this issue just cropped up on EVERY. SINGLE. SITE. on the server. Toggling hotlink protection on the first domain worked but not on the second. In the meantime, NO images were hot linked between www or other and clearing the cache/cookies didn't do anything although browsing in incognito or using a different browser other than chrome did eliminate the issue. UPDATE: Turn Off hotlink | hard reload site in affected browser | enable hotlink. , some images will now load, other still have the issues
I have something to add to this. When using Elementor in WP. I cloned site1.com to site2.com (different subscriptions). After cloning I got this hotlinking error on site2.com. Solution:
1. from site2 wp-content/ directory: grep -R site1.com *
2. found in uploads/elementor/css/ directory, .css files containing the old site1.com links, also found site.com links/urls in maintenance.php in the main wp-content directory
3. for each css file in /uploads/elementor/css/ directory
# sed -i 's/site1.com/site2.com/g' NameOfFile.css
(this searches and replaces inline, so be careful -- make backups of the css files first if you have none)
4. do the same for any other file you found with the old site domain name in links/references
* Note: we tried using the Velvet Blues Plugin to search and replace URLs but came up with an error and no changes, so I suspect there is something to do with Elementor that prevents this, but Velvet Blues should have done the maintenance.php file so that is a point to note.
At any rate, after using sed to search and replace all those instances of site1.com in the newly cloned wp site at site2.com everything was correct.
(of course you replace site1.com and site2.com with your real domain names)
Hope this helps someone.
Waiting for a fix. Thanks!
Does this block Google and all other search engines showing images in search as well Marc? I would assume it does, any way around that?
Hello @Wes Dunn,
Thank you for your question.
The issue, which is described in the article, can be met only if images are uploaded into httpdocs/wp-content/uploads folder path.
In all other cases, it should work as expected.
Oops ... not sure this post should be on this question, as it has nothing to do with mod-pagespeed, but I ended up reading this thread searching for solution for my problem after cloning. There might be a more pertinent question to post this solution to.
Please sign in to leave a comment.