Try this out:
/*
Plugin Name: Post Bulk Update
Description: Updates certain fields of my posts at once. On Activation. Awesome
Author: Me. I did it
*/
add_action('init','post_bulk_update');
function post_bulk_update(){
$posts_to_update = new WP_Query('cat=x&showposts=1000');
while($posts_to_update ->have_posts()) : $posts_to_update ->the_post();
$postUpdateArray = array();
$postUpdateArray ['ID'] = $post->ID;//Don't remove this. The ID is mandatory
$postUpdateArray ['post_title'] = 'Post Prefix: '.$post->post_title;
wp_update_post( $postUpdateArray );
endwhile;
}
For more reference see this.
Related Posts:
- Where is the old post permalink slug stored?
- Use category base slug in posts’ permalink
- Custom Post Types, slug, archive and SEO plugins
- How to automatically generate a unique random slug
- Post slugs and images cannot have same name?
- Change the Slug of Post Type post to baseurl/post/%postname%
- How to control which category will be picked for the slug of a post?
- Change slug with custom field
- Determining Slug Before and After Edit
- generate unique slug while inserting post
- How do I get the slug of a custom taxonomy category of a post?
- How to get posts by multiple post slugs? [duplicate]
- Define a name to the posts slug
- Bulk update post slugs through database
- How to have posts have a parent in permalink like site.com/blog/postname
- Automatically add date to the auto generation of post slug
- How to handle broken links created by permalink/slug changes?
- Visting slug for ‘post’ post type shows 404 not archive?
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- how do i add posts-page slug before posts slug in permalinks
- How to get a post’s content? [closed]
- Disable WordPress Archive Conflict Check
- Two Custom Post Types with Identical Articles Competing for the same Slug
- WordPress custom post type with folder structure in slug
- my post slug gets really long and I can’t change it
- Replace image name on upload to the new post name on front-end form
- Edit the post title from the frontend
- Show custom post with custom categories with specific slug
- Auto update post title and slug when post status is changed
- post type slug vs page slug
- Get post slug and match with menu item slug to change css
- How to 301 redirect from url with post id to permalink with post name (slug)?
- Slug collision between page, taxonomy and custom post type
- Word /blog/ in slug post, problems in CPT. Solutions?
- My post permalinks are always the same
- If I moved the location of my generic “posts” page, do I need to change the slugs for all of the individual posts?
- post_name is not stored until post is published… where should I store my slug until it goes live then?
- Post as frontpage – avoid duplicate content
- retrieve post slug by post_tags taxonomy
- Show all posts in category
- Echo author slug in post edit page
- Is there any point to using wp_unique_post_slug?
- Add tag to post api wordpress
- Confirmation box when submitting post for review
- How to show list of posts by author and category?
- Getting the Next and Previous Posts Titles in the Sidebar?
- Why is our post editor stuck at cols=40?
- how to limit and display tag?
- Insert custom div between posts
- Comments not showing in custom post type – WordPress
- Multiple loops in same page, without duplicate content
- How can I export and then import posts with featured images?
- How to add shortcode tags in single.php [closed]
- Is There A WordPress Plugin That Produces PDFs of Posts Locally?
- Query Post Preview Updates from the WP API?
- Convert a complex webpage into WP theme
- str_replace the_title(); blues
- Is there a better, more efficient way to get the post id outside the loop?
- How To Add One Tag to Multiple Posts?
- Automatically republish old posts
- Automatically Updating Publish Date Bug
- Properly display posts on homepage
- Add custom Facebook share link with share count and variable text
- I can’t format text in th edit page (or posts) whats wrong..?
- “more” tag doesn’t appear when browsing category achives or search
- How to exclude latest x posts from a paginated query?
- Auto Filling Post fields
- Help with Taxonomies
- ERROR: Your feed is invalid (after update WP4.7) in custom types
- WordPress Sidebar menu for posts based on date – guidance needed
- Update Post Meta is adding a value to my serialize array
- Is it possible to filter the main loop to exclude posts from a specific category?
- How to change the layout of posts when viewing all posts by tag [closed]
- Intercept page request and add value to it
- HTML Form Submit to table in same page
- Call current post URL in ajax
- How to select particular month post from table and update the post status using MySQL?
- how many visitor open this post? [closed]
- Have posts included on a page that share same category
- displaying the categories post
- Preview page/post revisions without overwriting current content
- Add CSS and JS files of the template post on a WordPress page
- New Post bubble
- Dev and prod on the same database- dev version active for IOS
- show only one category and filter by tag
- How can I exclude only a specific sub category post from category display?
- Update user meta when post published no working
- Posts are not showing up on next page.
- Is there a way to change the complete URL of the blog post for a redirecting tracking link?
- WordPress with static posts page and custom permalink structure doesn’t find posts with numeric permalinks
- My posts section for logged in user
- Latest posts on all pages
- Display all posts from selected month
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- Permalink remain the same on each page
- Displaying warning if no featured image has been set – Post Editor
- How to highlight most recent posts in a list
- wordpress show category link instead of post link [closed]
- CSS – Change height of Storefront / WooCommerce product categories, but not products
- Dynamic Menu Item