Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sazvader's avatar

Shopify Meta Tags

get_meta_tags method can retrieve meta tags from most sites, but not from Shopify sites, they throws 403 Forbidden error. I was wondering why is this the case and is there a way to bypass this?

0 likes
2 replies
Braunson's avatar
Braunson
Best Answer
Level 18

Shopify must check for a user agent set (likely to dissuade scrapers), since by default get_meta_tags does not include one you can set one and it will work.

ini_set('user_agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20100101 Firefox/7.0.1');
$tags = get_meta_tags('https://www.someshopifysite.com');
dd($tags);

Please or to participate in this conversation.