NewFirst month of Starter or Pro for $1Your first month of Starter or Pro for just $1, then cancel anytimeSee pricing
Ranken logoRanken.io

Add a blog to Shopify at /blog

The short answer

Shopify cannot proxy a path by itself, so a small Cloudflare Worker serves /blog from Ranken and passes every other request to your store. Your domain's DNS moves to Cloudflare with the Shopify records proxied.

Method
A Cloudflare Worker in front of your store
Time
About 4 minutes
You need
Your domain's DNS on Cloudflare
Ranken plan
Starter or Pro
yoursite.com/blog
/blog/*WorkerRanken blog
/*Shopify site
Only /blog goes to Ranken. Every other page keeps working on Shopify, on the same domain.

How do I add a blog to Shopify?

Create your blog in Ranken and choose a /blog subfolder, then follow these steps. The examples use www.yoursite.com/blog. Your dashboard shows the same steps with your own address filled in, plus a prompt you can paste into an AI coding assistant.

  1. 1

    Put your domain on Cloudflare

    Shopify can't proxy paths itself. Add the domain to Cloudflare and keep Shopify's DNS records proxied (orange cloud).

  2. 2

    Create a Cloudflare Worker

    Workers & Pages, then Create, then Hello World. Replace the code with this and deploy.

    worker.js
    // Ranken blog: /blog/* is served from Ranken.
    const BLOG_PATH = "/blog";
    const ORIGIN = "https://proxy.ranken.blog/your-blog";
    
    export default {
      async fetch(request) {
        const url = new URL(request.url);
        const rest = url.pathname.slice(BLOG_PATH.length);
        if (rest && !rest.startsWith("/")) return fetch(request); // another page, e.g. /blog-old
        const upstream = new Request(ORIGIN + rest + url.search, request);
        // Pages are cached at Cloudflare's edge for as long as Ranken's Cache-Control
        // allows; page-data requests (RSC header) are never cached here.
        const cacheable = request.method === "GET" && !request.headers.has("RSC");
        return fetch(upstream, cacheable ? { cf: { cacheEverything: true } } : undefined);
      },
    };
  3. 3

    Add the route

    In the Worker, open Settings, then Domains & Routes, and add the route www.yoursite.com/blog*

Shopify keeps /blogs/ for its own blog; /blog stays yours.

What should you check before you start?

  • Shopify keeps /blogs/ for its own blog. Use /blog, which stays yours.
  • Shopify also reserves /apps/, so keep the blog away from it.

Why put your Shopify blog at /blog instead of a subdomain?

A subfolder keeps every article on your main domain, so the links and authority each post earns build up in one place, next to your product or store pages. A subdomain such as blog.yoursite.com works too, but search engines can treat it more like a separate site. Ranken supports both, plus a custom domain.

Shopify blog questions

Does this affect checkout or my theme?

No. The Worker only runs on the /blog route. Product pages, collections, cart and checkout go to Shopify exactly as before.

Do I need a paid Cloudflare plan?

No. Workers and routes are available on Cloudflare's free plan, which covers the traffic of most store blogs.

Add a blog to another platform

Steps checked . See all integrations

Your Shopify site, now with a blog that ranks

Ranken hosts the blog at /blog with SEO, schema, llms.txt and one-click indexing built into every post.