☰

Getting Started

Deployment Deployment - Diagnose Migrations Staging

Site Management

Backups Client Reporting Passwords Plugin Automation Plugin Management - Global Plugins & Themes - Diagnose Plugins & Themes - General Plugins & Themes - Git Plugins & Themes - Logs Must Install White Label WordPress Updates

Caching & Performance

Caching Caching - Blogs/Articles Caching - Diagnose Caching - Git Caching - WooCommerce Redis Optimize & Scale

Security

Security Security - Firewall

SMTP, CDN & DNS

SMTP SendGrid CDN CDN - AWS CDN - Cloudflare CDN - Diagnose Domains & DNS

Server & Tools

Analytics & Logs CRON Jobs Database Debug Tool Git Monitoring PHP Settings Redirects SEO Tools Server Errors sFTP SSL

Staq Billing

Staq Billing > Account Staq Billing > Client Staq Billing > Setup

Media

Media Media - Diagnose Media - Optimize

Accounts & Billing

Accounts & Billing

General

WordPress Hosting Website Diagnose Troubleshoot - Other

Fixing CORS Errors


On this page

    CORS (Cross-Origin Resource Sharing) errors occur when resources (fonts, scripts, images) load from a domain or subdomain different from your primary domain. These errors often happen:

    • After migrating a website.
    • If the URLs (e.g., www vs. non-www) do not match the primary domain.
    • If resources load over HTTP instead of HTTPS.

    This guide explains how to resolve CORS errors using Staq tools.


    Common Causes of CORS Errors

    1. Primary Domain Mismatch:
      • Example: Resources load from https://example.com instead of https://www.example.com.
    2. Outdated Resource Links:
      • Example: HTTP links instead of HTTPS.
    3. Cached Files:
      • Theme, plugin, or server-side caches retain incorrect URLs.

    Step-by-Step Solutions

    1. Verify and Update Resource URLs Using Search & Replace

    To perform a Search & Replace in the database, you have two options:

    • inside the Staq Panel for the particular site; OR
    • inside the backend of WordPress via the Staq Hosting plugin.

    Follow this guide to do a database search and replace.

    2. Clear Staq Cache and Redis Object Cache

    Clear Staq Cache:

    • In WordPress backend → Hover over Staq Hosting → Click Clear Site Cache.
    • OR in the Staq Panel → Under Files, click Cache → Click Clear Cache.

    Flush Redis Object Cache:

    1. Go to the site’s Staq Panel → Under Database, click Redis Object Cache → Click Flush.
    2. OR in WordPress backend → Go to Staq Hosting → Object Cache → Click Flush Cache.

    3. Reset Theme and Plugin Caches

    Certain themes store cached URLs. Reset caches as follows:

    Theme/Page Builder Cache Clearing Instructions
    Avada Go to Avada → Options → Performance → Reset Avada Caches.
    Divi Go to Divi → Theme Options → Builder → Clear Static CSS File Generation.
    Elementor Go to Elementor → Tools → Regenerate CSS.
    Beaver Builder Go to Settings → Beaver Builder → Cache → Clear Cache.
    Bricks Builder Go to Bricks → Settings → System → Clear Cache.

    4. Verify CORS in Browser Developer Tools

    1. Open Developer Tools in your browser (right-click → Inspect → Console).
    2. Check for CORS errors (e.g., font or script file blocked).

    If the issue persists, ensure all URLs are consistent and contact Staq Support for server-side fixes.

    Need some help?

    We all do sometimes. Please reach out to our support team by dropping us a support ticket. We will respond fast.