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:


    Option 1 – Via Staq Panel

    1. Go to the site’s Staq Panel.
    2. Under Databases, click Search & Replace.

    Navigate to Search Replace

    1. Use the Search & Replace tool to replace outdated URLs:
      • Example: http://example.comhttps://www.example.com.

    Option 2 – Via WordPress Backend

    1. Log in to the website backend.
    2. Hover over Staq Hosting in the top toolbar → Select Settings.
    3. Go to AdvancedSearch & Replace.

    Search Replace Plugin

    1. Replace the incorrect URLs with the correct ones.

    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 HostingObject 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 AvadaOptionsPerformanceReset Avada Caches.
    Divi Go to DiviTheme OptionsBuilderClear Static CSS File Generation.
    Elementor Go to ElementorToolsRegenerate CSS.
    Beaver Builder Go to SettingsBeaver BuilderCacheClear Cache.
    Bricks Builder Go to BricksSettingsSystemClear 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.