menu_book Navigation menu

SEO

Pragma CMS does not use third-party plugins for SEO.

By integrating SEO directly into the core rendering pipeline, Pragma CMS ensures zero-overhead processing, perfectly structured data for traditional search engines (Google, Bing), and strict semantic clarity for modern AI crawlers (LLMs).

The SEO Rendering Pipeline

SEO is not a post-render afterthought. It is processed in a single pass during page compilation, eliminating the performance penalties commonly found in legacy CMS architectures.

  1. Data Resolution (Controller Layer): Resolves entry context, route parameters, and global settings.
  2. SEO Normalization: Computes canonical URLs, maps multilingual hreflang targets, and applies metadata fallbacks.
  3. Structured Data Collection: Aggregates dynamic JSON-LD schemas (FAQ, Breadcrumbs, Articles).
  4. Template Injection (base.php): Renders highly optimized, static HTML meta tags directly into the <head>, along with resource preloading (Core Web Vitals optimization).

Meta Data Resolution

Each page resolves base metadata using a strict, data-driven fallback chain to ensure no page is ever left blank.

Priority Order:

  1. Entry-level fields: Custom SEO set on the specific page or article (Highest priority).
  2. Page-level configuration: Rules defined for Listing/Archive pages.
  3. Site defaults: Global fallbacks configured in the Admin settings.

Supported Fields:

  • meta_title
  • meta_description

Open Graph & Twitter Cards

Social media metadata (OG and Twitter Cards) are handled automatically. If explicit social fields are missing, Pragma CMS infers them seamlessly from the standard Meta Data logic.

Supported Fields:

  • og:titleog:descriptionog:imageog:type
  • twitter:cardtwitter:titletwitter:descriptiontwitter:image

Note: If an Open Graph or Twitter image is missing at the entry level, Pragma CMS automatically falls back to the Default Social Image defined in the global SEO settings.

Real-Time Previews:

The Pragma CMS Admin interface includes real-time Google SERP and Social Media previews, allowing content editors to see exactly how their pages will appear on search engines and social networks before publishing.

Image & Media SEO

Pragma CMS natively supports best practices for image indexing. The integrated Media Manager centrally handles Alt texts and Captions (Legends) for all media assets.

Whenever an image is injected into a page, an article, or an Open Graph card, the CMS automatically outputs the associated semantic attributes, ensuring full compliance with Google Image Search and web accessibility (WCAG) standards.

Canonical URL Engine

Canonical URLs are dynamically generated based on the active route context to prevent duplicate content indexing.

  • Listing Pages: Query parameters are normalized. Pagination parameters (?page=x) are strictly removed from the canonical URL, while active filter parameters can be preserved.
  • Single Entries: Derived directly from the translated slug.

Multilingual Hreflang Automation

Multilingual indexing is completely automated via the routing layer (LanguageManager). Every page injects a precise language map based on active translations:

  • Emits <link rel="alternate" hreflang="x"> for all available translations.
  • Automatically includes the x-default fallback pointing to the primary site URL.
  • Crawl Budget Protection: The native UI Language Switcher intelligently detects missing translations and flags them with rel="nofollow", preventing search engines from crawling dead links and encountering soft-404s.

Indexing Control (Robots)

Indexing behavior is granularly controlled at the page level.

  • Default Logic: Published content is index, follow. Drafts and unpublished content are strictly noindex, nofollow.
  • Global Control: The robots.txt is dynamically generated, injecting the active multi-language sitemaps, blocking system directories (/admin/, /storage/, etc.), and allowing custom user-defined rules via the Admin settings.

Dynamic XML Sitemaps

Pragma CMS automatically generates and maintains XML sitemaps.

  • Sitemaps are instantly updated when content is published, modified, or deleted.
  • They natively support multilingual nodes (hreflang inclusion).
  • Pages marked as noindex or drafts are strictly excluded from the sitemap.

Native Redirection Engine

To preserve link equity (SEO juice) and prevent 404 errors during site migrations or content updates, Pragma CMS includes a highly performant, built-in Redirection Engine. This removes the need for .htaccess manual editing or heavy server-level plugins.

Supported HTTP Codes:

  • 301 - Moved Permanently (Primary SEO standard)
  • 302 - Found / Temporary Redirect
  • 307 - Temporary Redirect (Strict method preservation)
  • 308 - Permanent Redirect (Strict method preservation)

Advanced Match Types:

  • Exact Match: Targets a specific, precise URL.
  • Prefix (Starts with): Automatically captures and redirects an entire directory and its sub-pages (e.g., redirecting /old-blog/* to /news/).
  • Regex (Advanced): Allows developers to write Regular Expressions for complex URL restructuring rules.

Built-in Analytics (Hit Tracking):

The Redirection Engine automatically tracks the number of Hits and the last_hit_at timestamp for every rule. This allows administrators to know exactly which old URLs are still being crawled by Googlebot or clicked by users, making it easy to clean up obsolete redirects over time.

JSON-LD Structured Data (Schema.org)

To ensure maximum compatibility with Rich Snippets and modern AI knowledge graphs, Pragma CMS automatically generates and injects valid Schema.org structured data directly into the <head> of public pages.

Unlike rudimentary CMSs that output multiple disconnected JSON scripts, Pragma CMS merges all entities into a single, unified @graph, compliant with Google's strictest guidelines.

1. Default Global Schemas

On every public page, Pragma CMS automatically establishes the core identity of the site by generating the Organization and WebSite schemas. These are linked together using semantic @id references.

  • Organization: Provides Google with the site's identity, logo, and connected social media profiles (sameAs).
  • WebSite: Associates the URL with the organization to ensure Knowledge Panel consistency.
JSON
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": "https://example.com/#organization",
      "name": "Site Name",
      "url": "https://example.com",
      "logo": "https://example.com/media/logo.png",
      "sameAs": ["https://facebook.com/...", "https://linkedin.com/..."]
    },
    {
      "@type": "WebSite",
      "url": "https://example.com",
      "name": "Site Name",
      "publisher": { "@id": "https://example.com/#organization" }
    }
  ]
}

2. Dynamic & Contextual Schemas

Depending on the content type or active modules, the CMS automatically generates specific schemas to trigger Google Rich Results:

Schema TypeUsage
FAQPagePages with structured Questions & Answers
BreadcrumbListSite navigation and hierarchical path
ArticleBlog posts, news, and editorial content
WebPageStandard editorial pages
ProductE-commerce items and catalogs (if active)

3. Developer API (SeoManager)

Developers can easily inject or extend the structured data graph from anywhere within the application (controllers, plugins, or themes) using the SeoManager API.

Adding a standalone Schema (e.g., an Article):

PHP
SeoManager::addSchema([
    "@type" => "Article",
    "headline" => "Article Title",
    "datePublished" => "2026-01-01",
    "author" => [
        "@type" => "Person",
        "name" => "Author Name"
    ]
]);

Adding items to a Collection (e.g., FAQ):

Instead of worrying about the parent structure, developers simply add items to a collection. The CMS automatically wraps them in a valid FAQPage or BreadcrumbList schema during rendering.

PHP
SeoManager::addCollectionItem('faq', [
    "@type" => "Question",
    "name" => "How does the SEO pipeline work?",
    "acceptedAnswer" => [
        "@type" => "Answer",
        "text" => "It is fully native and single-pass."
    ]
]);

Adding Breadcrumb items:

PHP
SeoManager::addCollectionItem('breadcrumb', [
    "@type" => "ListItem",
    "position" => 2,
    "name" => "Blog",
    "item" => "https://example.com/blog"
]);

4. Security & Best Practices

  • CSP Compatibility: All <script type="application/ld+json"> tags are automatically protected by the core CSP nonce ($GLOBALS['csp_nonce']), ensuring strict Content Security Policy compliance without breaking SEO.
  • Zero Duplication: The internal engine automatically resolves collections to prevent duplicate schemas.
  • Frontend Isolation: JSON-LD is strictly injected on public-facing pages and is fully disabled in the Administration panel to prevent leaking internal structural data.

Internal Structural Signals

Beyond meta tags, Pragma CMS generates structured content relationships and internal signals crucial for crawler understanding and Core Web Vitals:

  • Resource Preloading: Critical assets (like main CSS) are natively preloaded (<link rel="preload">) in the head to optimize First Contentful Paint (FCP).
  • Breadcrumb Hierarchy: Managed dynamically by the BreadcrumbManager for consistent internal linking.
  • Semantic HTML5: Strict use of <main><nav><aside>, and <header> tags.
  • Accessibility (WCAG): Native #main-content-wrapper skip links for structural clarity and better user/screen-reader experience.

External Tracking Scripts

While not strictly SEO features, Pragma CMS allows the controlled injection of integration hooks for external services like Google Analytics, Tag Manager, or Meta Pixel.

Administrators can safely inject global scripts into the:

  • <head> (Head Scripts)
  • Start of the <body> (Body Start Scripts)

Example integrations

Google Analytics (head):

HTML
<scriptasyncsrc="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
window.dataLayer=window.dataLayer|| [];
functiongtag(){dataLayer.push(arguments);}
gtag('js',newDate());
gtag('config','G-XXXXXXX');
</script>

Meta Pixel (body start):

HTML
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window,document,'script',
'https://connect.facebook.net/en_US/fbevents.js');

fbq('init','XXXXXXXXXXXX');
fbq('track','PageView');
</script>