Bulk edit contents of pages

For any other readers I’d like to add in advance that this only really makes sense if you are kind of creating drafts or templates or whatever you want to call it that will be changed later on. Otherwise you’ll at least deal with SEO penalties due to duplicate content. Unfortunately this functionality isn’t part … Read more

New users not showing up in Post -> Edit

s_ha_dum’s answer prompted me to look into this a little further. I checked the users in the database. It turns out that the dropdown list in Posts -> Edit is using the Display Name, not the User Login, as I had expected. So, the problem was not that WordPress was functioning incorrectly, but that my … Read more

How do i change page template in bulk?

Try something like this: $pages = get_posts(); $page_ids_to_swap_the_template = array( 1, 2, 3, etc… ); foreach ( $pages as $page ) { if ( in_array( $page->ID, $page_ids_to_swap_the_template ) ) { update_post_meta( $page->ID, ‘_wp_page_template’, ‘new_template.php’ ); } }

Delete All Product Images in phpmyadmin

You can loop through all the woo-commerce products and delete them along with their attachment(images).. $args = array( ‘post_type’ => ‘product’, … ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php wp_delete_post( $loop->post->ID ); wp_delete_attachment( $loop->post->attachment_id ); ?> <?php endwhile; ?>

Creating bulk posts with Youtube videos

You already have your updateYoutube() function. Edit it to insert a new post. Very generally: function updateYoutube( $videocode ){ global $conn; $run = $conn->query(“SELECT `ID` FROM `youtubetable` WHERE `ID` = ‘$videocode'”); if ($run->num_rows > 0) return false; else { if ($conn->query(“INSERT INTO youtubetable (`ID`) VALUES (‘$videocode’)”) === TRUE) { // ################################# // NOTE: The following … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)