{"id":19720,"date":"2025-07-29T17:42:59","date_gmt":"2025-07-29T12:12:59","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/?p=19720"},"modified":"2025-07-29T17:43:01","modified_gmt":"2025-07-29T12:13:01","slug":"fix-custom-column-position-issue-in-magento-2-grid","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/fix-custom-column-position-issue-in-magento-2-grid\/","title":{"rendered":"Solution: Fix Custom Column Position Issue in Magento 2 Grid"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">While working with Magento 2 admin grids, it\u2019s common to add custom columns to default grids such as the Product Grid, Order Grid, Customer Grid, etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, a store owner may want to add a custom column to the product grid i.e:&#8221;Stock Status&#8221; &#8211; to quickly identify whether a product is in stock or out of stock, without opening each record individually. This requires customizing the product grid to include a new column.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, during such customizations, you might encounter issues where the newly added column appears at the end of the grid, even when a lower sortOrder value is specified or it doesn\u2019t load properly, or issues arise after applying filters or sorting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These problems typically occur due to how Magento 2 handles UI component grids.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here\u2019s what may be causing the issue:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The column was added via a plugin or observer rather than directly within the UI component XML.<\/li>\n\n\n\n<li>The cache or static files were not properly cleared after making changes.<\/li>\n\n\n\n<li>UI component XML was overridden or merged in unexpected ways.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Solution to Fix the Grid Column Position Challenges<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start with deleting the entry of the affected grid from the <strong>ui_bookmark<\/strong> table.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Magento 2, grid settings such as filters, column positions, and visibility are saved in the ui_bookmark table. Deleting the corresponding entry resets the grid to its default configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ensure your custom column has a correct and low sortOrder value in the UI component XML. Then, run these cache directories:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php bin\/magento cache:flush\n\nrm -rf generated\/* var\/view_preprocessed\/* pub\/static\/*\n\nphp bin\/magento setup:static-content:deploy<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">By following these steps, you can successfully fix custom column position issues in Magento 2 grid.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Need help implementing custom functionality in your Magento 2 store?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Explore our ready-made <a href=\"https:\/\/meetanshi.com\/magento-2-custom-order-grid.html\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 custom order grid<\/a> module an advanced order grid to add, track and manage order information in one place for faster order processing and accurate order management.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While working with Magento 2 admin grids, it\u2019s common to add custom columns to default grids such as the Product Grid, Order Grid, Customer Grid,&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-19720","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/19720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=19720"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/19720\/revisions"}],"predecessor-version":[{"id":19755,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/19720\/revisions\/19755"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=19720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=19720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=19720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}