By using wp_update_post()
, found in wp-includes/post.php:
// Update post 42
$post = array();
$post['ID'] = 42;
$post['post_category'] = array( ... );
$post['post_content' ] = 'This is the updated content.';
$post['post_title' ] = 'This is the updated title.';
// Update the post into the database
wp_update_post( $post );
Related Posts:
- Send an email when custom post type category is changed
- what is the action hook code to supporting product category condition in single product page of woocommerce?
- Remove “Category Archives: title” at the top of a category page [duplicate]
- Display all posts with same title
- Category Descriptions – HTML?
- Prevent function from triggering again when post in specific category gets another category?
- Show Subcategory Description
- Action hooks returning old category instead of new category
- How to display a description of a given category from a custom taxonomy
- Customized title tag for each page in pagination?
- How to get post category title within the loop?
- Single_cat_title() print the title before text
- Code to pull in a PHP file named after the category ID
- How to add custom script to the particular Product Category page
- How to remove the “+Add Category” button from the Category metabox?
- Hide posts of a certain category unless logged in
- in_category() works in single.php but not in page.php?
- Show only one category
- Implementing a tricky wordpress menu (nested categories + thumbnails)
- Taxonomy filter all children
- How to remove “Category : …”
- How to remove category titles?
- Second level subcategory
- Hard coded main navigation
- query in category.php repeats itself
- Move category description below post list in blog
- Applying A Category to Existing Posts Where Page Title Matches Regex
- Counter in loop in foreach
- Woo Framework: woo_cat_featured not populating
- Create menu locations for each category in wordpress
- Different Output for “Every Other” Foreach Statement?
- how to remove the default title of Categories widget
- “Item not updated” when try to change category properties
- How to Remove a Title from All Category and Tags Page?
- WordPress Show Parent Category Description for Sub-categories
- About title on a page
- How to access deleted term inside delete_product_cat action
- Set category page title in custom theme [closed]
- Filter WooCommerce archive pages by an additional category
- Show different title on category page
- Exclude category from foreach loop
- How to load several hierarchical categories from functions.php
- Explode() expects a string
- create function to call category name and slug
- Output Title of Post’s Current Category
- Add Custom Category Description When Empty
- How to hide description on categories and tags?
- Shop Category Pages missing s
- add woocommerce archive description if exist
- How to prevent tag “iframe” from being deleted from the heading description of rubric?
- Include a page’s “category” in its URL
- Get_term_meta() does not work with pre_get_posts()
- How Can I Display the Category Description in a Theme with no Category.php or Archive.php?
- Category name as page title
- Media Library Category Exclude Tree
- Multiple if statements with else for get_the_category [closed]
- Cant get unique_array() work on get_the_category() foreach loop
- How to add Pagination to foreach loop to page
- How to auto update post title and slug with category name when post status is updated
- How can I modify this code to iterate over an array of categories?
- How do you add Author and date Published on Category Pages?
- foreach,having wp_query inside, breaks after showing one result
- Category foreach Paging
- Loops in category description
- Display only the latest post
- Paginating a list of all posts collected by category titles
- Modify functions.php to add a term ‘uses-theme’ set to theme name on post save
- how to display page title only for child category pages
- how to edit wp category widget
- Call Current Category
- Page permalink rewrite
- Fix incorrect related posts code snippet
- Weird html output of single_cat_title – is not inside of the html element?
- How to hide my categories pages’ names, and how as well to reduce the space beween my sidebar’s widgets?
- Filter the blog title displayed in the header
- Deleting All tags except categories Wp database
- What is the advantage of using header-catname.php over is_category(‘catname’);?
- Custom WP_Query for current category (in category.php)?
- Why is get_the_category() saying that I have two categories?
- Using WP Category Lists Plugin to Dynamically Display Category (PHP)
- How to filter out Categories for specific post types on WordPress Admin?
- List categories with posts
- Refine/Filter the Search Results by Category
- Where and when does WordPress invoke routes
- Getting category URL with hyphens, not spaces
- How can I change the tooltip in the_category?
- How to get Next/previous_post_link to go through articles in top parent category
- Fix Warnings that shouldn’t be necessary to fix
- how to get correct category of a post in case of multiple categories?
- Show button only for certain Woocommerce Product Categories
- get listed category’s id?
- Use get() method to grab all categories and output inside another method
- Is it possible to create an alias/custom taxonomy for a category name?
- Multiple category columns and post counting list in wordpress Homepage
- Get permalink to latest post in category
- Group Posts by First Letter of Title categories
- Show a Category Specific Info Box
- Showing one post from each category, paged?
- hide_empty property not working when using get_terms
- Hierarchical outline of posts