Claude CodeCursor
Updated November 3, 2026

Add a blog with Claude Code.

Paste one prompt into Claude Code or Cursor, deploy, and paste the webhook URL into GrandRanker. Articles then publish to your /blog every day.

14-day money-back guarantee

The prompt
Set up a blog in this app that receives articles from an external service. Do ALL of the following:

1. Create a database table named "articles" using this app's existing database and ORM, with columns: external_id (text, unique, not null), title (text), slug (text, unique), content_html (text), content_markdown (text), meta_title (text), meta_description (text), subtitle (text), category (text), author_name (text), image_url (text), read_time (text), word_count (integer), tags (json), faqs (json), json_ld_schema (json), language_code (text), published_at (timestamp), updated_at (timestamp, default now).

2. Add an app secret named GRANDRANKER_SECRET (a shared webhook key) with this value: <your secret from GrandRanker>
   If you cannot set the secret value yourself, ask me for it and I will paste it. Never hardcode the value in the code — always read it from the environment.

3. Create a POST endpoint at "/api/articles-webhook" on this app's server. The endpoint must:
   - Accept JSON request bodies up to 10 MB (articles contain full HTML — the default body size limit is too small).
   - Return HTTP 401 if the "X-API-Key" request header does not equal the GRANDRANKER_SECRET environment variable.
   - Respond HTTP 200 to GET and HEAD requests (health check).
   - On POST: parse the JSON body. If "event_type" is "publish_articles", upsert every item in data.articles into the "articles" table keyed on external_id. Build each row using ONLY these columns and IGNORE any other field in the payload (the payload contains extra fields the table does not have, such as author_initials and hreflang_tags — do not try to write them): external_id (from the item's "id"), title, slug, content_html, content_markdown, meta_title, meta_description, subtitle, category, author_name, image_url, read_time, word_count, tags, faqs, json_ld_schema, language_code, published_at (from "publish_date"), updated_at. If "event_type" is "unpublish_article", delete the row where external_id equals data.id. Return HTTP 200 on success.

4. Build a "/blog" page listing articles from the "articles" table (newest first), and a "/blog/:slug" page that renders one article's content_html, using meta_title and meta_description for SEO tags. On the article page, also output: a <link rel="canonical"> tag with the page's full URL, og:title / og:description / og:image / og:url meta tags, and — if json_ld_schema is present — a <script type="application/ld+json"> tag in the page <head>. Both pages must be readable by search engine and AI crawlers — serve the article content and meta tags in the initial HTML response (server-side), not only after client-side JavaScript runs. Requests for a slug that does not exist in the "articles" table must return HTTP status 404, not a 200 page.

5. Serve a real "/sitemap.xml" route that returns XML (Content-Type application/xml) listing the /blog page and every article's /blog/:slug URL with its updated_at as lastmod, generated from the "articles" table on each request. Make sure robots.txt allows crawling and points to the sitemap. The sitemap must NOT be swallowed by a catch-all route that returns the app's HTML.

After you finish, confirm the webhook is reachable at /api/articles-webhook.

In GrandRanker, open Integrations, then AI Agent. The prompt there has your real secret in it.

What does the prompt build?

Five parts, all inside your own app and database.

articles table
What it doesStores every article, keyed on its GrandRanker id
GRANDRANKER_SECRET
What it doesShared key, read from the environment
POST /api/articles-webhook
What it doesSaves new articles, removes unpublished ones
/blog and /blog/:slug
What it doesServer-rendered pages with canonical and OG tags
/sitemap.xml
What it doesReal XML with every article URL

How to add a blog with Claude Code

Three steps. Cursor works the same way.

1

Copy the prompt

In GrandRanker, open Integrations, then AI Agent, and copy the prompt. It holds your secret webhook key.

Integrations › AI Agent
Copy prompt
Copied
2

Paste it into your agent

Claude Code or Cursor builds the table, the webhook, the blog pages and the sitemap. If it cannot set the secret, it asks you.

Claude Code
> Set up a blog in this app that receives articles…
articles table created
POST /api/articles-webhook
/blog and /blog/:slug, server-rendered
/sitemap.xml
3

Deploy and connect

Deploy your site, paste the webhook URL into GrandRanker, then click Test Connection and Save & Connect.

Webhook URL
yourapp.com/api/articles-webhook
Test Connection

Common mistakes to check

Open your deployed site and check each one before you connect.

The secret is hardcoded in the code
FixRead GRANDRANKER_SECRET from the environment
/blog renders only after JavaScript
FixRender articles on the server, in the first HTML
/sitemap.xml returns the app page
FixAdd the XML route before the catch-all route
Webhook rejects big articles
FixAllow JSON bodies up to 10 MB
Unknown slugs return 200
FixReturn 404 for slugs not in the table
Reviews

Trusted by top performers

Owen Pritchard
Owen Pritchard
@owenpritchard
first results in like 3 weeks. ditched paid ads immediately

setup was easy and the articles are actually good?? did not expect that

Dec 4, 2025

Tobias Wenger
Tobias Wenger
@tobiaswenger
page 5 → page 1 for our main keyword in under 6 weeks

we tried everything before this. nothing came close

Dec 2, 2025

Amara Diallo
Amara Diallo
@amaradiallo
The internal linking + keyword clustering alone is worth it

the fact that it also writes AND publishes? yeah that's just unfair

Nov 14, 2025

Carlos Medina
Carlos Medina
@carlosmedina_mx
Replaced a $4k/mo content agency with @grandranker

better results. fraction of the cost. only regret is not switching earlier

Dec 28, 2025

Suki Tanaka
Suki Tanaka
@sukitanaka
if you have a shopify store you need this

connected my blog, setup took 15 min, now getting organic traffic i never had. wild

Jan 3, 2026

Finn Callaghan
Finn Callaghan
@finncallaghan
using @grandranker for my SaaS blog

47 articles in a month, 12 already on page 1


the keyword research alone saves me hours every week

Nov 30, 2025

Anika Svensson
Anika Svensson
@anikasvensson
What got me is the content quality

these aren't generic AI articles. they match my brand tone perfectly. actually impressed

Dec 10, 2025

Katrine Holm
Katrine Holm
@katrineholm
was super skeptical about AI content ngl

but @grandranker articles actually read well. my audience hasn't noticed at all

Nov 5, 2025

Rosa Petrov
Rosa Petrov
@rosapetrov
launched a brand new site. zero authority. zero backlinks

@grandranker published 60 articles month one. already at 200+ daily visitors from google

Jan 12, 2026

Questions, answered

Short answers, with sources below.

Still unsure?

Ask us. A real person replies.

Contact us
Does this work with Cursor too?

Yes. The prompt is plain text for any coding agent that can edit your app, such as Claude Code, Cursor or ChatGPT. Paste it in, let the agent finish, then deploy.

Which stack does it need?

Any stack with a server and a database. The prompt tells the agent to use your app's existing database and ORM, and to render the blog on the server so crawlers get the full article.

Is the secret safe?

The prompt tells the agent to store it as an environment variable and never in the code. The webhook rejects any request without the right X-API-Key header.

Do I have to write the articles?

No. GrandRanker finds what your buyers search, writes the articles and sends each one to your webhook. You can edit any article before it goes live.

What if my site has no server?

Use a hosted blog instead. Point blog.yourapp.com at GrandRanker with one DNS record, and nothing changes in your code.

One prompt.
A blog that ranks.

Paste the prompt and publish your first articles this week.

Get Started