Title: Deactivating WPML breaks shortcode functionality
Last modified: April 16, 2019

---

# Deactivating WPML breaks shortcode functionality

 *  Resolved [ChriDi](https://wordpress.org/support/users/chridi/)
 * (@chridi)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/deactivating-wpml-breaks-shortcode-functionality/)
 * I installed and tested WPML for about a week. After deactivating it I realized
   the product_category shortcode wasn’t working as usual anymore. Like on the homepage,
   only 2 instead of 4 products were visible, but it depended on sorting and the
   particular category used in the shortcode.
 * Tuns out I was able to fix it by using the function provided on this site:
    [https://websavers.ca/woocommerce-shortcodes-not-showing-products](https://websavers.ca/woocommerce-shortcodes-not-showing-products)
 *     ```
       function custom_woocommerce_shortcode_products_query( $args ) {
          if ( 'yes' == get_option( 'woocommerce_hide_out_of_stock_items' ) ) {
            $args['meta_query'][] = array(
              'key' => '_stock_status',
              'value' => 'instock',
              'compare' => 'IN'
            );
          }
          return $args;
       }
   
       add_filter( 'woocommerce_shortcode_products_query', 'custom_woocommerce_shortcode_products_query' );
       ```
   
 * Thing is: why is this needed only after installing and deactivating WPML, never
   had issues with the shortcodes before. Somethign WPML might have messed up?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdeactivating-wpml-breaks-shortcode-functionality%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [jessepearson](https://wordpress.org/support/users/jessepearson/)
 * (@jessepearson)
 * Automattic Happiness Engineer
 * [6 years, 10 months ago](https://wordpress.org/support/topic/deactivating-wpml-breaks-shortcode-functionality/#post-11804318)
 * [@chridi](https://wordpress.org/support/users/chridi/) It’s possible that WPML
   may have broken the stock status of the products. It works by duplicating every
   post for the multiple languages. This means there are 2+ of every product in 
   the store, and they are linked together as well.
 * Were you able to find a permanent solution?
 *  [Mike W](https://wordpress.org/support/users/nixiack8/)
 * (@nixiack8)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/deactivating-wpml-breaks-shortcode-functionality/#post-11839688)
 * Hi [@chridi](https://wordpress.org/support/users/chridi/),
 * We have not heard back from you in a while, so I am going to go ahead and close
   this thread. If you are still experiencing issues and it is tied to WooCommerce(
   WPML is redirecting you back here) please open a new thread, reference this one
   and let us know!
 * Have a great day 🙂

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

The topic ‘Deactivating WPML breaks shortcode functionality’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Mike W](https://wordpress.org/support/users/nixiack8/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/deactivating-wpml-breaks-shortcode-functionality/#post-11839688)
 * Status: resolved