Search
 
SCRIPT & CODE EXAMPLE
 

PHP

remove all post in wordpress by query

$allposts= get_posts( array('post_type'=>'product','numberposts'=>-1) );
foreach ($allposts as $eachpost) {
wp_delete_post( $eachpost->ID, true );
}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel blade time difference 
Php :: how to create a get route in Laravel 
Php :: create a user using tinker 
Php :: PHP strrev — Reverse a string 
Php :: guzzle post request with data 
Php :: how to run a specific migration in laravel 
Php :: in loop how add string by comma in php 
Php :: php string replace regex 
Php :: php artisan drop table 
Php :: how to write php in javascript file 
Php :: array_search in php 
Php :: how to add title to wordpress php 
Php :: laravel validate unique column 
Php :: php subtract date from today 
Php :: php while loop of alphabet 
Php :: create wordpress user programatically 
Php :: how to get the average in sql in php 
Php :: symfony get query param 
Php :: sanitize user input php 
Php :: check if number is multiple of 3 in php 
Php :: php remove prefix from string 
Php :: case inside laravel query 
Php :: mysqli php 7.4 
Php :: [DoctrineDBALDBALException]Unknown database type enum requested, DoctrineDBALPlatformsMySqlPlatform may not support it. 
Php :: php file for image load 
Php :: php session time out default 
Php :: add user meta 
Php :: laravel order by relationship 
Php :: php turney if 
Php :: php get bearer token from request 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =