Speed factor of any function that deals with content such as wp_insert_post()
or wp_delete_post()
highly depends on the situation and the content that it’s dealing with.
Let’s make a simple example. You have a post, that contains featured image, dozen of tags, categories, a thousand custom fields, assigned taxonomies, and a hundred more. When you run a command to delete this post, you are not just trying to delete a permalink from the database, you are also trying these:
- Detach the post thumbnail
- Remove a dozen of term relationships
- Run a loop and deal with a million of metadata
- And possibly more.
If you run a SQL command and just remove the post’s data from the database (not recommended), it might speed up to thousands of posts per second. But, fully removing the content and unlinking the relationships is heavy.
Related Posts:
- I have over 4000 posts, will querying some of them cause performance issues?
- Multiple social buttons with a fast loading? [closed]
- Improving WP_Query for performance when random posts are ordered
- WP Admin register taxonomy and post type performance
- Is there any upper limit for the number of posts that can be created with wordpress
- Get posts and include taxonomy term
- Fast publishing in wordpress
- Can Permalink structure of %postname%/%post_id% improve performance
- Is it possible to modify posts table to only read for more recent ones?
- Check if almost 10 year old – working code is up to date
- Maximum number of posts per page before affecting performance?
- Delete 100+ posts or media files from wordpress faster than default?
- Is there a maximum amount of pages for a multi-page post?
- What effect can a large wp_post table have on overall site performance?
- Get WordPress post content by post id
- Get page ID of page that is set as the posts page
- Get Posts Under Custom Taxonomy
- How to limit the number of posts that WP_Query gets?
- Stop WordPress Wrapping Images In A “P” Tag
- When is the ‘post_content_filtered’ column in database cleared by WordPress?
- Turn a URL into an Attachment / Post ID
- GET the excerpt by ID
- Stop WordPress automatically adding tags to post content
- Determine if page is the Posts Page
- How to get ‘post_content’ without stripping tags?
- How to add an admin notice upon post save/update
- Print Current Post Index number within Loop
- Should we trust the post globals?
- Optimize post insert and delete for bulk operations?
- Get the Current Page Number
- How do you add thumbnail support for custom post types?
- How to mark every 3rd post
- Change Posts per page count
- Keep featured content post in homepage with original order
- How to display related posts from same category?
- Can posts have parents?
- Is there a action hook for the “Empty Trash” button?
- How to end the excerpt with a sentence rather than a word?
- How do I check if I linked to a post before I delete it?
- How to change the case of all post titles to “Title Case”
- Appending content with broken in 4.4
- How to get posts published between a date and today?
- ZIP up all images displayed in a [gallery] and offer as download link
- How to detect single.php (but not single-portfolio.php)?
- How to check if post meta key exists or not in wordpress database
- How to remove a column from the Posts page
- removing inline styles from wp-caption div
- What is the use of to_ping and pinged column?
- How to use “Add link” pop up for a WordPress widget
- Remove Categories / Tags From Admin Menu
- How to retrieve text only from wp_content() not from wp_excerpt()?
- Stop WP from creating “Sample Page” and “Hello World!” post
- Where is the old post permalink slug stored?
- How to Create Editable Blocks of Text for the Homepage?
- Keyboard shortcut for updating a page or post?
- Add custom Attachment Display Setting for images
- Rewriting post slug before post save
- Apply the_title() filter in post & page title, but not in menu title
- How to Change Order of Posts in Admin?
- is it possible to get next_post_link
- Get post content by ID
- How to get post creation date?
- Update post counts (published, draft, unattached) in admin interface
- Function to execute when a post is moved to trash .
- How to get post ID of the current page/post inside a widget?
- add action only on post publish – not update
- How to display by default only published posts/pages in the admin area?
- How do you add Read more … link to posts?
- How to make comments work for a post loaded per Ajax?
- Is there an if statement that can determine if a post in the loop is the last post?
- Get current menu_order
- How to show related posts by category
- Changing the post date and time with function
- simply loop through posts
- Difference between an archive and a page listing posts
- Delete Associated Media Upon Page Deletion
- Set Default Listing “View” in Admin
- Access post from post id in URL
- Count posts within a custom post type and specific taxonomy and terms?
- How to add category to: ‘wp-admin/post-new.php’?
- Post preview mechanism architecture
- How to prevent posts from being published too close to each other?
- Passing current cookies in wp_remote_get to get Draft Post Preview
- How to hide specific Gutenberg blocks settings from users
- Post featured image column on admin post list page
- How to Display a List of Users Who Have Made at Least 1 Post?
- The next_posts_link() works only with original $wp_query
- display all posts in wordpress admin
- Front-End Post Submission
- Is there a way I can write a series in WordPress?
- Get content from one page and show it on another page
- Get Next / Prev 3 Posts in Relation to Current Post
- How to Check if a Page Exists by URL?
- Including categories in search results
- How To Disable (or Remove) “All Posts, Published, and Trash” in Dashboard Posts
- How to protect pages with double authentication: password + email (in custom field)
- How To Have Two Gutenberg Editors On One Post?
- Use category base slug in posts’ permalink
- Separate Database Tables For Different Post Types
- Customizing HTML Editor Quicktags button to open a dialog for choosing insert options