How to bulk edit canonical url’s in SQL?

Down- and uploading CSVs is a tough one that forces you to make a bunch of steps manually which is prone to human error (and typos). My suggestion would be to do something that you can battletest locally in a local copy of your DB. Steps to follow: Make a database dump using the mysqldump … Read more

cron job to auto delete posts of a specific post type older than x days

// add the schedule event if it has been removed if( ! wp_next_scheduled( ‘mg_remove_old_entries’ ) ) { wp_schedule_event( time(), ‘daily’, ‘mg_remove_old_entries’ ); //run the event daily } // action hooked to fired with wordpress cron job add_action( ‘mg_remove_old_entries’, ‘mg_remove_old_entries’ ); function mg_remove_old_entries() { $posts = get_posts( [ ‘numberposts’ => -1, ‘post_type’ => ‘vfb_entry’, ‘date_query’ => … Read more

Remove all links to a specific website

You can use the Search Regex plugin. This will allow you to create a regular expression to intelligently search and replace across all of your posts. After you activate the plugin, go to Tools, Search Regex. If you want to remove all links to http://example.com, here is one regular expression you could try: /<a href=”http:\/\/example\.com[^>]*>([\s\S]*?)<\/a>/ … Read more

How to remove bulk edit options

A more reliable approach than messing with CSS would be to add some Javascript in the admin_head action, and basically override the built-in “inlineEditPost” function (located in wp-admin/js/inline-edit-post.js and easier to read in inline-edit-post.dev.js). I haven’t looked into it much specifically, but the brute force method would be to copy (and rename) that entire function … Read more

Custom bulk actions in WP 3.7.1

You’re seeing $action empty because there is a redirect from wp-admin/edit.php. So, the output you are seeing is after the redirect. Use, die() after echo $action to see the output before the redirect.

URL Redirect and Bulk Actions in wp_list_table

Understand hierarchy, You don’t need to redirect as form are posting values on same page. function process_bulk_action() { // Some security check code here // Get the bulk action $action = $this->current_action(); if ($action == ‘bulk_trash’) { // Code for the “delete process” $delete_ids = esc_sql($_POST[‘bulk-delete’]); //loop over the array of record ids foreach($delete_ids as … Read more

Is there a way to expose additional fields to the Bulk Action > Edit functionality?

A quick google search yielded these results for me: https://premium.wpmudev.org/blog/wordpresss-bulk-edit/ https://wordpress.org/plugins/custom-bulkquick-edit/ https://wordpress.org/plugins/tags/bulk-edit/ I am sure there is a way, but I do not think that there is a WP API for that (like options API or transients API, etc…). Maybe you can see what these free plugins are doing and how. Edit: I found the … Read more

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