This is how it worked for me:
– uploaded the file into site root
– ran it from the subsite, like this: http://subsite.mainsite.com/my-script.php
It ended up inserting the new post into the subsite.
Related Posts:
- Using wp_insert_post() with Networking enabled
- WP_INSERT_POST issue on WordPress Multisite
- Using wp_insert_post with WP Network in a cron script
- switch_to_blog($blog_id); still writing to main blog
- How to disable a network enabled plugin for just one site?
- What are options are there to implement a multi language site
- Where is the robots.txt stored for a WordPress Multisite install?
- Settings API in Multisite – Missing update message
- WordPress Multisite Multiple child theme
- WordPress Multisite: How to make all media library items available for every site?
- How to setup LDAP authentication with WP multisite
- Set default avatar network-wide
- wp-activate.php causing white screen of death
- WordPress Multisite. Can domain be used instead of subdomain?
- Multisite Subdomains result in 403 Forbidden
- Set subdomains live in a next step
- 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?
- restore_current_blog() vs. multiple switch_to_blog() followed by removing $GLOBALS[‘_wp_switched_stack’]
- Multisite Installation: how do I setup global search?
- How do I set a default theme in multisite network
- Two WordPress sites sharing the same database
- Multisite use language code as subdirectory
- Help with updating a wp_get_sites to get_sites and sorting by alphebetical order
- Sub-subdomain getting redirected to main domain
- Using $wpdb Class to Pull Recent Comments Across a Network
- Multisite – create new site with precreated pages, menu etc
- WordPress (+WPMU) Import/Export ALL settings?
- WordPress multisite change language
- 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?
- Hook up MU site creation
- Migrate a WP website from a single-server single-domain to a multi-server multi-domain installation
- Fresh Multisite Install – Can’t Log In
- current_user_can() always returns true if user is super admin
- multisite hook for Add Existing User
- Displaying a message upon user registration
- Upload file type not permitted even if explicitly registered as upload_filetypes in the db (multisite)
- Database Tables Lost Indexes? How to Recover?
- ReWriteRules and WordPress Multi-Sites with Sub Directories
- How can i redirect my Blog to a Subdomain?
- WordPress Multisite Redirection Issue
- migrating content from a single wordpress installation to a multisite
- Multisite user roles – capabilities not working
- WordPress: how to change URL for individual MultiSites?
- Change main site in multisite install?
- Move Multiple WP Installs on a single domain to WP Multisite
- Widget not displaying in WMPU sites
- Enable “My blogs” in a custom installation
- HTTPS Warning and Certificate Error when Updating Network
- Complex WordPress Website
- Where to set individual blog quotas?
- Create sub-domain for multisite and multi languages?
- How to retrieve Post Excerpt from a different site in the Network
- Changing the language for each individual site in wordpress multisite
- how to have __() translating in languages different from admin?
- How to temporarily redirect front page of a network to one of the sites/blogs?
- Multisite: Redirect to appropriate domain if subdomain doesn’t exist
- How to change a user role after registering in multisite?
- Set a default page template to load for multi-site
- Multisite questions
- Move existing WordPress install to Multisite
- Delete user from multisite when removed from subsite
- how to control display switch_to_blog( $subsite->blog_id ); $tags = wp_tag_cloud
- WordPress multisite with domains and subdomains
- Which Multi-language option for WordPress is best from an SEO and Woocommerce perspective?
- Multisite 404 page
- Sort posts according to date
- Folder structure when using multiple domains with WordPress
- Multisite for main in subdirectory, subdomain and subfolders (EN/ES)
- the_content not working on one of two Multisite sites
- filter posts without images or featured image
- On a multisite environment, get the subdomain value as variable
- Tracing non-uniform slowdown on a multisite install with multiple domains
- After switch domain, some parts of my site still point to my old domain
- Hook into ‘admin_url’ but only on Mysites admin bar menu
- Add file at the root of mapped domain in multisite
- Looking for most efficient way to ‘deploy’ single wordpress page to multiple external subdomains
- WordPress multisite REST API connection refused with android – redirects to home page when using IP address in Postman
- Multisite installation steps?
- Pass form inputs to page content
- How to show theme on front end before sign up for multisite
- How to connect existing subdomains to new wordpress multisite?
- WordPress Multisite with cPanel Addon Domains and SSL
- Multisites with different root directory
- New domain in multisite environment
- Domain Mapping with WPMU
- Using www along with non-www for main domain in multisite installation
- Multisite “Skip Confirmation Email” Log Out Problem
- Admin user getting redirected to /wp-admin/user
- Getting 404 after Update in Multisite
- WordPress MU – Creating a site takes ages
- Default sub-pages on WordPress Multisite
- WordPress Multisite – Questions about select all posts from all network sites
- personal_options hook on WordPress multisite
- Multi site and media uploader
- There is no featured image in my post in wordpress multisite theme [closed]
- Subdomain add comment redirect to 404 not found page iis server