Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Twitter image access problem

Started by nix 6 years ago · 3 replies · 1561 views
6 years ago

Hello all,

I have a problem with my twitter image metadata that happens often to me with grav.
I have defined my metadata like this:
<meta name="twitter:image" property="twitter:image" content="http://radioglaces.net/user/themes/radioglaces/images/radioglaces_twitter.png" />

But Twitter doesn't manage to access it when i test it in the card validator , it outputs this log:

YAML
INFO:  Page fetched successfully
INFO:  18 metatags were found
INFO:  twitter:card = summary_large_image tag found
INFO:  Card loaded successfully
WARN:  The image URL http://radioglaces.net/user/themes/radioglaces/images/radioglaces_twitter.png specified by the 'twitter:image' metatag may be restricted by the site's robots.txt file, which will prevent Twitter from fetching it.

So it doesn't display the image. My robots.txt file is defined like this:

YAML
User-agent: *
Disallow: /backup/
Disallow: /bin/
Disallow: /cache/
Disallow: /grav/
Disallow: /logs/
Disallow: /system/
Disallow: /vendor/
Disallow: /user/
Allow: /user/pages/
Allow: /user/themes/
Allow: /user/images/
ALlow: /user/themes/radioglaces/images/

User-agent: Twitterbot
Allow: /user/themes/radioglaces/images/radioglaces_twitter.png

Do you know what I am doing wrong?
Webpage in development is here
Thanks in advance.

6 years ago

I am also having this exact problem. And the robots.txt seems to be Ok, as the path for the image is allowed. Google robots.txt test tool will also confirm that this is correct, so I believe that this is a problem with Twitter robots rules detection...

6 years ago

Adding these lines in the end of the robots.txt file seems to work:

YAML
User-agent: Twitterbot
Allow: /user/themes/radioglaces/images/radioglaces_twitter.png
Allow: /user/pages/
Allow: /user/themes/
Allow: /user/images/
ALlow: /user/themes/radioglaces/images/
👍 2

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 90 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 449 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 44 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 123 3 months ago