Documentation

DeleteSEO

Delete SEO pages via the Backend API.

DeleteSEO

Backend API to delete existing SEO pages programmatically. Usage is charged from your credit balance.

Server-side only. deleteSeoPage and the raw API must be called from the server only. Never use them in client-side code (e.g. React components, browser JavaScript)—the secret key would be exposed. Use API routes, server actions, or backend scripts instead.

Properties

PropertyTypeRequiredDescription
pageIdentifiersarray of PageIdentifiersYesAn array of PageIdentifiers to identify which pages to delete.

PageIdentifiers

PropertyTypeRequiredDescription
pathstringYesThe page path. Must begin with '/'.
pageIdstringNoThe pageId of the SEO page. Optional alternative to path for identifying a page.

API Reference

Endpoint: POST https://v1.seomanager.dev/backend_api/seo/delete

Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
x-projectidYesYour project ID.
x-projectkeyYesYour project key.
x-projectsecretkeyYesYour secret key. Keep this private and never expose it client-side.

Request Body

{
  "pageIdentifiers": [{ "path": "/example" }]
}

Response Shape

// Success
{ message: "Successful", results: { succeeded: true }, error: false, statusCode: 200 }

// Error
{ results: false, error: true, message: "Error description" }

Examples

cURL

curl -X POST https://v1.seomanager.dev/backend_api/seo/delete \
  -H "Content-Type: application/json" \
  -H "x-projectid: YOUR_PROJECT_ID" \
  -H "x-projectkey: YOUR_PROJECT_KEY" \
  -H "x-projectsecretkey: YOUR_SECRET_KEY" \
  -d '{"pageIdentifiers":[{"path":"/example"}]}'

Python

import requests

url = "https://v1.seomanager.dev/backend_api/seo/delete"
headers = {
    "Content-Type": "application/json",
    "x-projectid": "YOUR_PROJECT_ID",
    "x-projectkey": "YOUR_PROJECT_KEY",
    "x-projectsecretkey": "YOUR_SECRET_KEY",
}
payload = {"pageIdentifiers": [{"path": "/example"}]}

response = requests.post(url, json=payload, headers=headers)
print(response.json())

PHP

<?php
$url = "https://v1.seomanager.dev/backend_api/seo/delete";
$payload = ["pageIdentifiers" => [["path" => "/example"]]];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "x-projectid: YOUR_PROJECT_ID",
    "x-projectkey: YOUR_PROJECT_KEY",
    "x-projectsecretkey: YOUR_SECRET_KEY",
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);
echo $response;

Node.js (fetch)

const response = await fetch("https://v1.seomanager.dev/backend_api/seo/delete", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-projectid": process.env.SEO_MANAGER_PROJECT_ID,
    "x-projectkey": process.env.SEO_MANAGER_PROJECT_KEY,
    "x-projectsecretkey": process.env.SEO_MANAGER_SECRET_KEY,
  },
  body: JSON.stringify({
    pageIdentifiers: [{ path: "/example" }],
  }),
});
const data = await response.json();

Node.js with nextjs-seo-manager (Next.js)

These examples run in API routes (server-side only)—never in client components.

Pages Router (API route)

// pages/api/delete-seo.js
import SEOInit from "nextjs-seo-manager/init";
import { deleteSeoPage } from "nextjs-seo-manager";

SEOInit({
  projectId: process.env.SEO_MANAGER_PROJECT_ID,
  secretKey: process.env.SEO_MANAGER_SECRET_KEY,
});

export default async function handler(req, res) {
  try {
    const response = await deleteSeoPage([{ path: "/example" }]);
    return res.status(200).json(response);
  } catch (err) {
    return res.status(500).json({ error: err.message });
  }
}

App Router (API route)

// app/api/delete-seo/route.ts
import { NextRequest, NextResponse } from "next/server";
import SEOInit from "nextjs-seo-manager/init";
import { deleteSeoPage } from "nextjs-seo-manager";

SEOInit({
  projectId: process.env.SEO_MANAGER_PROJECT_ID,
  secretKey: process.env.SEO_MANAGER_SECRET_KEY,
});

export async function POST(request: NextRequest) {
  try {
    const { identifiers } = await request.json();
    const response = await deleteSeoPage(identifiers);
    return NextResponse.json(response);
  } catch (err: any) {
    return NextResponse.json({ error: err.message }, { status: 500 });
  }
}

Limitations

  • The pageIdentifiers array is limited to 50 items per call.
Explore

More documentation

Getting Started

Set up nextjs-seo-manager for your Next.js project.