Title: Disable sortable UI for attributes
Last modified: October 21, 2019

---

# Disable sortable UI for attributes

 *  Resolved [WP Native](https://wordpress.org/support/users/nazreenexe/)
 * (@nazreenexe)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/disable-sortable-ui-for-attributes/)
 * Hello there,
 * How do I disable/prevent sortable UI in the frontend? I just wanted to disable
   drag reorder attributes in the variable product section
 * [https://wordpress.stackexchange.com/questions/2474/disable-dragging-of-meta-boxes](https://wordpress.stackexchange.com/questions/2474/disable-dragging-of-meta-boxes)
 * > [View post on imgur.com](https://imgur.com/cOVHyi1)
 * Help would be much appreciated 🙏
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdisable-sortable-ui-for-attributes%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [con](https://wordpress.org/support/users/conschneider/)
 * (@conschneider)
 * Engineer
 * [6 years, 6 months ago](https://wordpress.org/support/topic/disable-sortable-ui-for-attributes/#post-12049182)
 * Hi there,
 * I would say the Javascript answer in your Stackexchange post is the way to go.
   You can wrap the Javascript in a control statement that checks whether you are
   in the front end to only execute it there.
 * Kind regards,
 *  Thread Starter [WP Native](https://wordpress.org/support/users/nazreenexe/)
 * (@nazreenexe)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/disable-sortable-ui-for-attributes/#post-12050468)
 * I’d much appreciate it if you could add that snippet here..
 * 🙏🙏
 *  [wprock](https://wordpress.org/support/users/wprock/)
 * (@wprock)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/disable-sortable-ui-for-attributes/#post-12052421)
 * I tried this snippet
 *     ```
       add_action( 'admin_footer', function(){
       	$screen       = get_current_screen();
       	$screen_id    = $screen ? $screen->id : '';
           if ( ! in_array( $screen_id, array( 'product', 'edit-product' ) ) )
           	return;
       ?>
           <script type="text/javascript">
               jQuery( function( $ ) {
                   $( function() {
                       // Attribute ordering.
                       $( '.product_attributes' ).sortable({
                           items: '.woocommerce_attribute',
                           disabled: true
                       });
   
                       $( '.woocommerce_attribute h3 .sort' ).css('cursor', 'pointer');
                    });
               });
           </script>
       <?php
       }, 999);
       ```
   
 * I added the code into functions.php file

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

The topic ‘Disable sortable UI for attributes’ 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/)

## Tags

 * [attributes](https://wordpress.org/support/topic-tag/attributes/)

 * 3 replies
 * 3 participants
 * Last reply from: [wprock](https://wordpress.org/support/users/wprock/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/disable-sortable-ui-for-attributes/#post-12052421)
 * Status: resolved