🎩 SEO Quality Gates in Jenkins Pipelines

Add SEO regression detection as a Jenkins pipeline stage.

Jenkins Declarative Pipelines support SEODiff validation via a simple sh step. Add it as a deployment gate to block releases with SEO regressions.

Configuration

Copy this configuration into your project:

pipeline {
    agent any
    environment {
        SEODIFF_API_KEY = credentials('seodiff-api-key')
    }
    stages {
        stage('SEO Validation') {
            steps {
                script {
                    def result = sh(
                        script: '''
                            curl -s -w "\\n%{http_code}" \\
                              -X POST "https://seodiff.io/api/v1/validate" \\
                              -H "Authorization: Bearer $SEODIFF_API_KEY" \\
                              -H "Content-Type: application/json" \\
                              -d "{\\"url\\": \\"${PREVIEW_URL}\\", \\"wait\\": true}"
                        ''',
                        returnStdout: true
                    ).trim()

                    def httpCode = result.split('\n').last()
                    if (httpCode == '409') {
                        error('SEO regression detected — blocking deployment')
                    }
                }
            }
        }
    }
}

Setup Steps

Add credential

Manage Jenkins → Credentials → Add seodiff-api-key as a Secret Text credential.

Add the stage to your Jenkinsfile

Insert the SEO Validation stage before your deploy stage.

Run the pipeline

Jenkins blocks the build if SEODiff returns HTTP 409 (fail).

What Gets Checked

The /validate endpoint runs a surface scan and checks for SEO regressions. For deeper testing, combine it with the /agent/evaluate endpoint to add custom assertion rules:

no_placeholders

Find template variables like {{city}} or [TBD] that leaked into production HTML.

max_token_bloat

Detect when boilerplate overwhelms useful content for LLM crawlers.

has_schema

Ensure every page has valid JSON-LD schema markup for rich results.

min_schema_count

Require a minimum number of JSON-LD schema blocks per page.

View all 17 assertion rules →

Other Integrations

Start testing in 30 seconds

Get an API key and run your first evaluation with a single cURL command.

Get API Key or Read full API docs