Warning: include_once(/home4/aquapan/public_html/cjbarnaby/wp-content/plugins/wp-super-cache/wp-cache-phase1.php): failed to open stream: No such file or directory in /home/revela25/public_html/cjbarnaby/wp-content/advanced-cache.php on line 22
Warning: include_once(): Failed opening '/home4/aquapan/public_html/cjbarnaby/wp-content/plugins/wp-super-cache/wp-cache-phase1.php' for inclusion (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/revela25/public_html/cjbarnaby/wp-content/advanced-cache.php on line 22
Warning: include(/home4/aquapan/public_html/cjbarnaby/wp-content/plugins/wp-super-cache/wp-cache-base.php): failed to open stream: No such file or directory in /home/revela25/public_html/cjbarnaby/wp-content/plugins/wp-super-cache/wp-cache.php on line 137
Warning: include(): Failed opening '/home4/aquapan/public_html/cjbarnaby/wp-content/plugins/wp-super-cache/wp-cache-base.php' for inclusion (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/revela25/public_html/cjbarnaby/wp-content/plugins/wp-super-cache/wp-cache.php on line 137
Warning: include_once(/home4/aquapan/public_html/cjbarnaby/wp-content/plugins/wp-super-cache/ossdl-cdn.php): failed to open stream: No such file or directory in /home/revela25/public_html/cjbarnaby/wp-content/plugins/wp-super-cache/wp-cache.php on line 174
Warning: include_once(): Failed opening '/home4/aquapan/public_html/cjbarnaby/wp-content/plugins/wp-super-cache/ossdl-cdn.php' for inclusion (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/revela25/public_html/cjbarnaby/wp-content/plugins/wp-super-cache/wp-cache.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at /home/revela25/public_html/cjbarnaby/wp-content/advanced-cache.php:22) in /home/revela25/public_html/cjbarnaby/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /home/revela25/public_html/cjbarnaby/wp-content/advanced-cache.php:22) in /home/revela25/public_html/cjbarnaby/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /home/revela25/public_html/cjbarnaby/wp-content/advanced-cache.php:22) in /home/revela25/public_html/cjbarnaby/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /home/revela25/public_html/cjbarnaby/wp-content/advanced-cache.php:22) in /home/revela25/public_html/cjbarnaby/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /home/revela25/public_html/cjbarnaby/wp-content/advanced-cache.php:22) in /home/revela25/public_html/cjbarnaby/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /home/revela25/public_html/cjbarnaby/wp-content/advanced-cache.php:22) in /home/revela25/public_html/cjbarnaby/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /home/revela25/public_html/cjbarnaby/wp-content/advanced-cache.php:22) in /home/revela25/public_html/cjbarnaby/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /home/revela25/public_html/cjbarnaby/wp-content/advanced-cache.php:22) in /home/revela25/public_html/cjbarnaby/wp-includes/rest-api/class-wp-rest-server.php on line 1893
{"id":3997,"date":"2023-03-07T01:38:24","date_gmt":"2023-03-07T01:38:24","guid":{"rendered":"http:\/\/cjbarnaby.com\/?p=3997"},"modified":"2023-03-07T01:38:59","modified_gmt":"2023-03-07T01:38:59","slug":"bulk-move-woocommerce-categories-under-specific-parent","status":"publish","type":"post","link":"http:\/\/cjbarnaby.com\/bulk-move-woocommerce-categories-under-specific-parent\/","title":{"rendered":"Bulk Move Woocommerce Categories Under Specific Parent"},"content":{"rendered":"\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\tUse at your own risk.\r\n\r\nIf you don’t know where this goes you should not be even attempting to use this.\r\n\r\n \r\n\r\n \t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\n\/\/\/ bulk move under a specific category parent by ID's\n\nfunction bulk_set_product_category_parent() {\n $parent_category_id = 149; \/\/ Replace with the ID of the parent category\n $args = array(\n 'taxonomy' => 'product_cat',\n 'hide_empty' => false,\n 'include' => range(184, 200), \/\/ Range of category IDs to update\n );\n\n $categories = get_categories($args);\n\n foreach ($categories as $category) {\n $category_id = $category->term_id;\n wp_update_term($category_id, 'product_cat', array(\n 'parent' => $parent_category_id,\n ));\n }\n}\n\nadd_action('admin_init', 'bulk_set_product_category_parent');\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"
Use at your own risk. If you don’t know where this goes you should not be even attempting to use this. \/\/\/ bulk move under a specific category parent by ID’s function bulk_set_product_category_parent() { $parent_category_id = 149; \/\/ Replace with the ID of the parent category $args = array( ‘taxonomy’ => ‘product_cat’, ‘hide_empty’ […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,3137],"tags":[],"class_list":["post-3997","post","type-post","status-publish","format-standard","hentry","category-attachments","category-woocommerce"],"yoast_head":"\n
Bulk Move Woocommerce Categories Under Specific Parent - cjbarnaby<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n