You can try using wp cron functions, programing a feed import every 10 minutes or so, until you have nothing left in queue.
Example code:
<?php
register_activation_hook( __FILE__, 'wp1903_schedule_cron' );
function wp1903_schedule_cron() {
$counter = 0;
$feeds = array(
'http://example.com/feed1',
'http://example.com/feed2',
'http://example.com/feed3',
'http://example.com/feed4'
);
foreach ($feeds as $feed) {
$counter++;
// schedule every 10 mins
$time = time() + (600 * $counter);
wp_schedule_single_event( $time, 'wp1903_process_feed', $feed );
}
}
add_action('wp1903_process_feed', 'wp1903_import_feed');
function wp1903_import_feed($feed_url="") {
// do the import
}
It is essential only to run the scheduler on a activation hook, or else at every page load the crons will be rescheduled.
Related Posts:
- Function to return true if current page has child pages
- Cleaning up WordPress to improve performance?
- List of all theme customizer control types?
- How to preserve PHP modifications while upgrading WordPress?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Change comments form title on a page by page basis
- Setting up the child theme so as to enable right-to-left WordPress?
- delete an array element when its date expires
- How to add default images into theme customizer image control?
- Overriding a theme redux file in child theme
- PHP can I add line numbers to file_get_contents()
- Setting custom canonical urls
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Converting HTML Template to WordPress Theme
- How to check if a meta value has already been assigned to any user?
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How to pick the default selected value in wordpress dropdown?
- Modify custom field input data before creating a new post
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Need help enqueueing webfonts
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Create page template via functions.php?
- How to create a field in customize and show that in header.php?
- List post by title length
- How do i wrap woocomerce attribute in list?
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- Is there a hack for using is_page() within the function.php file?
- Customize field names in backend profile edit page through function.php [duplicate]
- WP insert post Redirect after function has executed
- WP-Bakery – Add custom colors to buttons with template colors
- Trying to update Woocommerce meta values
- update_user_meta as multiple value but with same meta key
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Delete post meta by serialized meta value
- Remove node from multisites?
- Automatically refresh page if widget is added to page?
- Where can I find the declaration of `$_wp_theme_features`?
- How do I routinely extract the thumbnail of the most recent post?
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Check if values exists DB
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- How to add button to top of theme customizer?
- How can I clear the theme mod settings?
- Display a list of users with avatar filterable with alphabets
- Select area and checkbox data is not saving?
- WP Custom tables query
- Add multiple HTML attributes to an Elementor button
- Mega Menu Walker
- How to call a function only once (global variable scope)
- Multiple is_page() in page.php
- Get author full name
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- How to correct schedule my event weekly with wp_schedule_event()
- Post source link plugin – small modification
- Execute a shortcode when clicking on a image
- Edit postmeta when user changes user role?
- How can update custom meta for all posts
- syntax issue on php 7.4
- How can I use wp_insert_comment to write a comment when a post is edited?
- How do you add customer capability after Woocommerce purchase?
- functions.php is being included twice, creating PHP fatal errors
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- How to put a variable in a instance in the widget
- get a simple array of all of the term names that exist in all taxonomies
- Show categories then when clicked on a category list all sub category and when clicked show all posts in that sub category
- How to store data from multiple forms using ajax and php
- How to control WordPress image metadata (using Imagick)?
- Removing “wpautop” (auto tags) only on certain pages?
- Extend plugin Class through functions.php
- Output custom field value to post string
- Redirect to another page using contact form 7? [closed]
- Run a code only on theme activation only during first activation
- Shortcode from a function not working
- Underscore – Self hosted fonts
- Is it possible to return content, and then also continue to do other things?
- Creating WordPress Shortcode with Variable
- Add meta tags to a custom header
- How to use mysql LIKE with wpdb?
- Function sanitize_title() does not appear to be working
- Displaying Event within two given time frames
- How to prevent a function from running based on host (ie web vs local)?
- How to call custom function outside from the admin page?
- Display movies that apear this day next
- Delete images from media library when user deletes an image from ACF Gallery
- Array data not saving to specified sections. How to make seting independantly?
- Reject all malicious URL requests functions.php
- Integrate otp in my custom singup form
- Notice: Undefined variable
- How to override WooCommerce Order Item Meta with data from Cart?
- Taxonomy Child Term, Counter is staying on 0
- Need help with PHP functions
- Using get_theme_mod with checkbox to display content
- WordPress styling recent post
- Break a WordPress function to run in patches and re-continue
- Pagenav Not appearing on custom Template
- How do I change the Go To Categories link in the term_updated_messages
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]