Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
  • #24560

    Hi again,

    I’m experiencing an issue with Facebook OGP’s default image, or rather the ability to access the image. I’ve uploaded a 200px x 200px image to my WP media and copied the file URL to be used as the default image, but the file can only be accessed if the image has previously been viewed from the lightbox in its assigned post, and if admin is logged in; otherwise, a 404 error is displayed.

    For example, if you try and visit the image directly at you’ll get error 404.

    However, you can see the image at

    When logged in as admin, if I right click the thumbnail and click copy link/link location and paste it in the address bar of my browser I can then access it. Facebook object debugger also fails to show the thumbnail; but, if you hover over it, it appears.

    I have no idea why this is happening.

    Any help will be appreciated.

    Thank you,



    Hi Dan,

    I don’t know why that would be happening. I’ve never run across something like that with wordpress before but it sounds as if there is a permissions issue on the file. Perhaps its a chmod issue on the wp-content folder and the files inside of it. So you could try looking at those and see what they are.




    Hey, all directories down to the image file have read and execute permissions for public, and the files themselves have just read permission for public.

    I’ve just noticed actually, that error 404 appears when trying to link directly to any image; as though, images can only be accessed subsequently via prior action such as such as clicking a gallery thumbnail: in turn activating the lightbox. Is this a protective feature of the flashlight theme?




    I clicked this link but I don’t get a 404 page.

    I don’t think there is “security feature” for images unless you make a certain post password protected.




    Strange. Checking again, I definitely get a 404 error; and when trying to share the site on Facebook, the thumbnail doesn’t show. Here’s a screenshot of the error just for confirmation’s sake:

    Ishmael, I presume the image shows when you click the link and don’t get the 404 error?





    Yes, I get it now. When I paste the image link, I get a 404 page. Please remove browser cache then reload the page. Do you have cache plugin?

    Please try the following plugin:

    1.) This plugin will enable you to fix 404 images.

    2.) This plugin will suggest another page when a user ends up visiting a 404 page

    You should probably ask your host if mod_rewrite is installed on your server.




    Hi Ishmael,

    I have noticed something which may indicate the cause of the problem.

    Firstly, mod_rewrite is on, and thank you for those plugins.

    What I’ve noticed: 404 errors only result if I set permalink to a non default, such as ‘Post name’. When permalink is configured at its default setting, the image instead displays a 403 error; but, directly linking to all other images now works.



    UPDATE: turns out I was missing ‘Options +FollowSymlinks’ from my .htaccess file. Adding this fixes 404 errors for all images (when using custom permalink) EXCEPT the facebook ogp image. I deleted and re-uploaded the image file, assigned it to a published post, but I’m still unable to link to it directly. Strange.



    Did you try to rename the image? Make sure that the image path is correct and that the file name does only contain lowercase characters and no “special” characters.




    Hi Peter,

    I’ve uploaded the image as ‘opengraph.jpg’ now, but experience the same problem :-/

    In fact, when I said the problem is now resolved for all images except the Facebook OGP one, I was wrong. I’ll give an example for my Tarn Hows HDR image.

    1. Via the WP Media Library, I find the Tarn Hows image, click it to edit media, copy the file URL, and paste it into a new browser tab. This results in error 404.

    2. Also, from the media editor page, I press ‘View Attachment Page’; from there, if I right click the thumbnail on the attachment page and press ‘copy link address’ pasting that into a new browser tab, that action also results in error 404.

    3. However, navigating via the site portfolio, selecting the HDR gallery, first, left clicking the masonry thumbnail of Tarn Hows to let it load in its lightbox; then, closing the lightbox view and right clicking to select ‘Copy link address’; then pasting that into the address bar of a new browser tab, the image loads.

    I tried replicating this in Firefox and IE with all browser data cleared, skipping to point 3 – accessing the image by first letting it load in the lightbox – and the image loaded fine this way. To me, this indicates the image will only load via direct URL access if it is first in the browser cache from when the lightbox loaded it.

    All attempted method of direct access to the image have the same URL: from when copying the URL from the media editor, or when right clicking the thumbnails in points 2 and 3.

    Tarn Hows URL

    From copying the file URL from the media library/editor:

    From copying link address from attachment page thumbnail:

    From copying link address from HDR portfolio masonry thumbnail:

    Kind regards,




    Is there a reason you are running out of a subfolder? When you go to Settings in admin , what do you have set for the URL?




    I re-copied the .htaccess file from the root directory to the ‘dgphotography’ sub-folder, and edited it to the following, which solved the problem: this can be verified through clicking any of the links above :-)

    # BEGIN WordPress

    <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteBase /dgphotography

    RewriteRule ^index.php$ – [L]

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule . /dgphotography/index.php [L]


    # END WordPress

    If you’re wondering why I’m editing the .htaccess file manually, that’s because WordPress edits the root .htaccess file due to being the site URL, and being the WordPress address.

    The rewrite worked with the base and rule as ‘/’ and as ‘/dgphotography’ so didn’t no which one was right?

    Thanks for planting a seed in my brain Nick that made me check this, and thank you all for helping me along the way :-)





    No problem. Glad I was able to help. Your .htaccess looks a bit light. You should add some stuff in it like shown here just need to uncomment the stuff that you need.



Viewing 12 posts - 1 through 12 (of 12 total)

The topic ‘Facebook Open Graph Protocol Default Image Issue’ is closed to new replies.