I have a site with loads of posts (news items). Some posts don't have featured images yet. Adding the images to those posts (few hundreds) is a tedious task. We basically want to add 1 and the same image to all the posts without a featured image. Is there a way to do this in bulk? Like ADD 'this image' to ALL 'posts' (not pages) WHERE 'featured_image' is empty. I really hope there's a plugin for that. Can't find it …
I am using this function which works great in case anyone wants to bulk update custom fields for custom post types (just change parameters as necessary). $args=array( 'posts_per_page' => -1, 'post_type' => 'mycptype' ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); $testa = get_field('br_type'); $testb = get_field('br_category'); if ($testa === 'Apples') { update_field('br_featured', '0', get_the_ID()); } endwhile; wp_reset_postdata(); endif; How to use: Insert the code inside your functions.php and refresh …
What are the options to capture all posts or pages on a specific path - including multiple levels of parent pages - and update status (published -> draft)? Thanks
Let's start with an example of what I want to do. take a look at hardreset.info / devicesfaq.com as you can see, the articles are almost the same, they only change few keywords / or based on title (device name) let's say I have the same categories and a custom article for each one (hard reset, check imei, delete google account, etc). Ok, now I want to post in bulk in all the categories I choose (check imei, hard reset, …
The WordPress codex for bulk_edit_custom_box, along with this bulk edit example use the following piece of JavaScript to create an array of selected post IDs to send with the AJAX call that updates the posts. $bulk_row.find( '#bulk-titles' ).children().each( function() { $post_ids.push( $( this ).attr( 'id' ).replace( /^(ttle)/i, '' ) ); }); The full code surrounding this snippet is below. My list tables have input fields for meta values, and the inline quick edit works successfully, but bulk edit fails. When …
I created a class extend WP_List_Table and created method for bulk actions like this : function get_bulk_actions() { $actions = array( 'synchronize' => 'Synchronize', 'delete' => 'Delete from Shareino', ); return $actions; } and another method for processing their : function process_bulk_action() { //Detect when a bulk action is being triggered... if ('delete' === $this->current_action()) { wp_die('Items deleted (or they would be if we had items to delete)!'); } } This action's display in a dropbox but when i select …
How to create a custom panel inside wp admin dashboard where we can insert media to specified posts in bulk? Here is the illustration: As shown on the image above, it list all available media on the left and provide the box where we can insert post id to attach the media to. And we can then bulk insert media to the specified posts by hit the attach buttons after we specified the post id for each listed media. I …
I have to change my all 3000 published post status to draft. one way to do it one by one or another option is to select bulk post... but bulk selecting also takes a lot of time because I have around 3000+ posts. any easy way to do it? or any plugin? Thank You
I have google sheet with rows like "Name", "Price". I would like to create website with folowing things: Website automaticly sync with google spreadsheet and update "Name", "Price" In website any user can check this table, input numbers in "Amount" row. 3."SubTotal" row for each "Name" will automaticly calculate, according to "Amount". "SubTotal"="Price"*"Amount" Button, which can place user's order with all names, prices, amounts and calculations info which user choose. "Total" will automaticly calculate sum of all "SubTotal" values. I …
The media library is currently organized by months and years .../uploads/2021/09/. I'd like to go without the months and year and use the url .../uploads/ for future uploads. For consistency, I'd like to move the existing media files to .../uploads/ too What will be a faster way to move the files instead of uploading them? sudo mv gives me the error -bash: /usr/bin/sudo: Argument list too long.
I need to bulk update 86 specific WordPress Pages every 10 minutes, with the term updating I mean the same thing as clicking the Blue Update Button on each page, and having them all update at the same time every 10 minutes. I guess I need to write a function into my theme functions.php file, and maybe trigger the function every 10 minutes with the help of the plugin WP Crontrol, or maybe using the Cron in cPanel. I'm a …
I am creating several posts from a csv, when I execute the code using a cronjob the operation lasts about 7 minutes, but if I use the code directly in a template, or make a call to do_action or execute the code through ajax it takes more than 30 minutes and sometimes it doesn't even complete (generates a time limit error). Does anyone know what could be happening? For the creation of the posts I am using wp_insert_post, update_post_meta and …
I've resurrected a Blogger blog from the Wayback Machine. The business that did the migration had all of the blog's comments in each post included in the post itself. I would like to keep the years-long history of the comments, but have each be its own comment in Wordpress. Is this possible? A short example of what I have is Post Title and date [Post main body 22 Comments [long block of text for old comments] End post] 0 Comments …
I'm new in this forum and fairly new to Wordpress as a whole, so I hope I will abide by all written and unwritten rules when posting this. I have an SQL database with around 4,000 posts from an old website. Each post has an ID, date, title, body, keywords, and category column (and some others that are irrelevant). These columns are, as far as I've seen it, not named in a default manner but are, at least in part, …
I'm wondering if there is some sort of equivalent to Drupal's Batch API in WordPress? Basically, the API allows you to register a batch request and Drupal will call your function over and over again (with Ajax requests) until your batch is finished. So if you need to perform a complicated update on 1,000,000 posts, you can do so in a batch without having PHP timeout or run out of memory. (You just have to tell Drupal how far along …
I'm trying to add a custom bulk action in the WooCommerce orders list that will a piece of code I've made for individual orders but need to make it work recursively. I'm aware of that: Custom bulk_action but it is referring to wordpress bulk action menus and not specifically for woocommerce. could you please help me get it working in my plugin for woocommerce orders list? Furthermore, I'm also a bit stuck about how, after adding that action, to scan …
I have a multisite and a new theme that needs to be activated across all subsites. I found an answer by fuxia from 2012 and would like to know (1) if there have been changes in WordPress since that time that would require an update to this filter, and (2) what other methods exist to accomplish this task, like using the switch_theme function or using MySQL if it is about updating an option. Reference: Changing Multisite themes on mass
I imported over 1000 posts from a Tumblr gallery. All the posts are untitled, but each has a photo and name inside of the post. How do I make take the content of each post and make it the post name?
I have 500 users with 50 of those users assigned to user-role XYZ. I'd like these 50 XYZ users to keep their current XYZ user-role but also be assigned another/additional/extra/second user-role ABC... as a bulk job. I'm looking for a function that could find all users with user-role XYZ then assign them to a second user-role of ABC