Title: get_terms() broken
Last modified: March 28, 2025

---

# get_terms() broken

 *  Resolved [llucssll](https://wordpress.org/support/users/llucssll/)
 * (@llucssll)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/get_terms-broken/)
 * Hi,
 * Im using this plugin to order the taxonomies of my CPT, but when I enable the
   plugin the get_terms() function stops returning the taxonomies and returns an
   empty array instead. If I disable the plugin all goes back to normal and it prints
   all my taxonomies.
 * This is the code I use:
 *     ```wp-block-code
       register_post_type('products',array('labels' => array('name' => __('Productes', 'ssll'),'singular_name' => __('Producte', 'ssll')),'public' => true,'has_archive' => false, // False Si no te archive page'menu_position' => 22,'menu_icon' => 'dashicons-image-filter','supports' => array('title', 'editor', 'thumbnail'),'rewrite' => array('with_front' => false),));register_taxonomy('prod-categories', // The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).'products', // post type name in lowercase (not slug)array('hierarchical' => true,'label' => 'Categoríes', // display name'query_var' => true,'show_admin_column' => true, // Display in backoffice's post_type table'rewrite' => array('slug' => 'prod-category', // This controls the base slug that will display before each term'with_front' => false // Don't display the category base before)));
       ```
   
 * I then use the following code to print the taxonomy:
 * $prod_tax = get_terms(array(‘taxonomy’ => ‘prod-categories’));
 * var_dump($prod_tax);

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [beatrice12](https://wordpress.org/support/users/beatrice12/)
 * (@beatrice12)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/get_terms-broken/#post-18393763)
 * Hello [@llucssll](https://wordpress.org/support/users/llucssll/),
 * Thanks for reaching out to us!
 * Please try enabling debug mode to see if there are any errors. Open your `wp-
   config.php` file and add this:
 * `define('WP_DEBUG', true);
   define('WP_DEBUG_LOG', true);define('WP_DEBUG_DISPLAY',
   false);
 * Then check the `/wp-content/debug.log` file after running `get_terms()`. If there’s
   an error, it might tell us what’s wrong.
 * If that doesn’t help, try using the [Health Check & Troubleshooting plugin](https://wordpress.org/plugins/health-check/).
   It has a troubleshooting mode, which lets you temporarily disable all plugins
   and switch to a default theme.
 * Once you’re in Troubleshooting Mode, enable only **Simple Custom Post Order**
   and test `get_terms()`. If it works, start enabling your other plugins one by
   one to see which one is causing the issue.
 * Let me know what you find!
 * Warm regards,
 * Beatrice.
 *  Thread Starter [llucssll](https://wordpress.org/support/users/llucssll/)
 * (@llucssll)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/get_terms-broken/#post-18406834)
 * Hi [@beatrice12](https://wordpress.org/support/users/beatrice12/) ,
 * I’ve tried to disable all plugins and it works fine. But as soon as I enable 
   Simple Custom Post Order it stops working.
 * Enabling WP_DEBUG shows this:
 * **WordPress database error:** [Unknown column ‘t.term_order’ in ‘order clause’]
   `
   SELECT t.term_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id
   = tt.term_id WHERE tt.taxonomy IN ('prod-categories') ORDER BY t.term_order ASC`
 * Im pretty sure this is a plugin bug, as there’s nothing else on my end affecting
   the result.
 * Thanks!
 *  Plugin Support [beatrice12](https://wordpress.org/support/users/beatrice12/)
 * (@beatrice12)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/get_terms-broken/#post-18419764)
 * Hello [@llucssll](https://wordpress.org/support/users/llucssll/),
 * Please go to website.com/wp-admin/options.php on your site and look for the option
   called scporder_install. Set it to 0 and save.
 * When the plugin is first activated, it’s supposed to add a `term_order` column
   to the `wp_terms` table in the database. In your case, that step probably didn’t
   run properly.
 * Let me know if you have questions!
 * Warm regards,
 * Beatrice.
 *  Plugin Support [beatrice12](https://wordpress.org/support/users/beatrice12/)
 * (@beatrice12)
 * [1 year ago](https://wordpress.org/support/topic/get_terms-broken/#post-18430777)
 * Marking this support thread as resolved due to inactivity. If you have any other
   questions or need further help please open a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘get_terms() broken’ is closed to new replies.

 * ![](https://ps.w.org/simple-custom-post-order/assets/icon-256x256.jpg?rev=2969435)
 * [Simple Custom Post Order](https://wordpress.org/plugins/simple-custom-post-order/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-custom-post-order/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-custom-post-order/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-custom-post-order/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-custom-post-order/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-custom-post-order/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [beatrice12](https://wordpress.org/support/users/beatrice12/)
 * Last activity: [1 year ago](https://wordpress.org/support/topic/get_terms-broken/#post-18430777)
 * Status: resolved