FLASH SALE Get 20% OFF everything using the coupon code: FLASH20 View WordPress Plugins →

Missing Open Graph Images? Remove Image Hotlinking!

on in WordPress
Last modified on

I have just found out that my image hotlinking solution was preventing social networks from reading my Open Graph image tags. Pretty silly.

I had these lines in my .htaccess file:

# Prevent image hotlinking
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?getbutterfly.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?codecanyon.net [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?themeforest.net [NC]
RewriteRule \.(jpg|jpeg|png|gif|webp|mp4)$ - [NC,F,L]

Notice how I only allow specific hosts from accessing my images and my media content.

Luckily, a recent update to W3P SEO helped me discover this issue. After removing the lines above, the images started appearing again on all social networks. I need to re-share, re-post, re-tweet everything again now, just so I can show off my featured images.

Related posts