I would prefer to do this at web server level.
If you are on NGINX server, you can use in your site conf file:
add_header Access-Control-Allow-Origin *;
If you are on Apache server, you can use in your .htaccess:
Header set Access-Control-Allow-Origin "*"
Related Posts:
- Troubleshooting a “You do not have sufficient permissions to access this page” error
- Restrict users on multisite WordPress install
- Can you have multi-site WP and keep users separate?
- Restrict the user access in multi site for non-assigned blogs
- Multisite Independent User Base
- Sharing Header Components Across Multisite
- How can I get multisite primary blog (url or path) for current user?
- WordPress Multisite prevent direct access to subdomain
- access the plugins for each role in WordPress multisite
- How to protect post attachments related to a custom post type, from non-logged in users, on 1 subsite of a multisite installation?
- Multisite registration problem [closed]
- Good way to block users within a multisite setup without deleting them?
- Subsite access without being a member of the subsite in wp multisite network
- Multi-Site Subfolder User Permission Issue
- 3 blogs on one site with the same header menu?
- One Site as a part of Multisite to be hidden (Un-published) from Public?
- Disable site visiting and user logins excepting for a specific user
- Hiding media uploaded by other users in wordpress multisite?
- Common user login for two different wordpress installation and bbpress
- How to check main site user level from subsite in a multisite network
- Give users acces to admin a single post or set up WP network?
- Change header.php of a specific WordPress Multisite
- Users getting linked unwanted to main mu in WordPress multisite (WPMU)
- WordPress Multisite FQDN Admin Access
- Some Subdomains on a Multisite Install Not Found
- Multisite Login Access Restrictions
- How to disable a network enabled plugin for just one site?
- Plugin for editing options on multisite?
- Set default avatar network-wide
- wp-activate.php causing white screen of death
- Change wordpress Multisite default site from side id 1 to side id 2
- Multisite: Develop locally using production images with .htaccess
- latest 5 posts using switch_to_blog loop
- How to prevent hotlinking with htaccess in WordPress and why most common use about it doesn’t work?
- Why can’t a WordPress network (multisite) in it’s own folder use subdomains?
- restore_current_blog() vs. multiple switch_to_blog() followed by removing $GLOBALS[‘_wp_switched_stack’]
- How do I set a default theme in multisite network
- WordPress Multisite Login Access
- Switch_to_blog() outside wordpress
- Multisite use language code as subdirectory
- How to remove the Tools menu item from the WP-Admin menu
- Sub-subdomain getting redirected to main domain
- Using $wpdb Class to Pull Recent Comments Across a Network
- Default content for a new site in multi site
- WordPress (+WPMU) Import/Export ALL settings?
- wordpress htaccess is hijacking my .mp4 files
- How to work on a live WPMS blog when domain is unresolved? [closed]
- How do you load WordPress from an external script when using MultiSite? [duplicate]
- Has WP and MU fully merged?
- Why is ‘is_multisite’ returning true when it’s a single install?
- Hook up MU site creation
- Migrate a WP website from a single-server single-domain to a multi-server multi-domain installation
- Forcing SSL Protocol for Multisite Subdomain Child Sites + cPanel Configuration
- Website DR using Multisite
- current_user_can() always returns true if user is super admin
- multisite hook for Add Existing User
- Displaying a message upon user registration
- How to redirect one page on the subdomain
- ReWriteRules and WordPress Multi-Sites with Sub Directories
- WordPress Multisite Redirection Issue
- Multisite user roles – capabilities not working
- WordPress: how to change URL for individual MultiSites?
- Change main site in multisite install?
- Enable “My blogs” in a custom installation
- HTTPS Warning and Certificate Error when Updating Network
- Complex WordPress Website
- List recent 25 blogs across the network
- Performance disadvantge of second installation instead multisite feature?
- What is the simplest way to disable multisite leaving one of the sites only?
- What does multi-site WordPress application mean?
- Add wordpress multi sites with different port number from 80
- Create website with a switch between private and business [closed]
- Can’t create a subdomain network – and WP is installed in webroot, not a folder
- How to make my third multisite blog start with id 1000?
- Forward and mask a WordPress website
- Filter meta request
- Subdomain is not working
- How to automatically create an index of child sites at the root url for a multisite installation?
- Does switch_to_blog support array or other ways to show all posts on a network install?
- How to make subdomain and muti-site but wordpress isn’t in root?
- Show buddypress profile fields in a multsite blog [closed]
- Migration: previous URL redirection after migrating
- Add www to the Root Site in WP Multisite Network
- Multisite problem with unexisting paths to CSS etc
- URLs for (MultiSite) link images are always relative
- How to allow mixed case characters in multisite site name?
- Separated Theme file on multi site network in subdomain
- register_setting() for single site vs update_site_option() for mu
- How To Change the URL of a WordPress Multisite
- Sending SMTP mail using a server with self-signed SSL
- Site w/ Addon Domain doesn’t show CSS
- WordPress MU – Creating a site takes ages
- Default sub-pages on WordPress Multisite
- WordPress Multisite – Questions about select all posts from all network sites
- Multi site and media uploader
- Comment reporting for Multisite
- How to display the most popular posts of all the blogs in a mu setup? [duplicate]
- WordPress MS wp-admin/includes/post.php error with shortcode generator
- Subdomain add comment redirect to 404 not found page iis server
- All links to images are broken in a subdomain multi site environment