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
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
| Part | What it does |
|---|---|
| articles table | Stores every article, keyed on its GrandRanker id |
| GRANDRANKER_SECRET | Shared key, read from the environment |
| POST /api/articles-webhook | Saves new articles, removes unpublished ones |
| /blog and /blog/:slug | Server-rendered pages with canonical and OG tags |
| /sitemap.xml | Real XML with every article URL |
How to add a blog with Claude Code
Three steps. Cursor works the same way.
Copy the prompt
In GrandRanker, open Integrations, then AI Agent, and copy the prompt. It holds your secret webhook key.
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.
Deploy and connect
Deploy your site, paste the webhook URL into GrandRanker, then click Test Connection and Save & Connect.
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
| Mistake | Fix |
|---|---|
| The secret is hardcoded in the code | Read GRANDRANKER_SECRET from the environment |
| /blog renders only after JavaScript | Render articles on the server, in the first HTML |
| /sitemap.xml returns the app page | Add the XML route before the catch-all route |
| Webhook rejects big articles | Allow JSON bodies up to 10 MB |
| Unknown slugs return 200 | Return 404 for slugs not in the table |
Trusted by top performers
setup was easy and the articles are actually good?? did not expect that

Dec 4, 2025
we tried everything before this. nothing came close

Dec 2, 2025
the fact that it also writes AND publishes? yeah that's just unfair

Nov 14, 2025
better results. fraction of the cost. only regret is not switching earlier

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

Jan 3, 2026
47 articles in a month, 12 already on page 1
the keyword research alone saves me hours every week

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

Dec 10, 2025
but @grandranker articles actually read well. my audience hasn't noticed at all
Nov 5, 2025
@grandranker published 60 articles month one. already at 200+ daily visitors from google
Jan 12, 2026
Questions, answered
Short answers, with sources below.
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.
