diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 754e988..4a0e004 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -18,7 +18,6 @@
 
 import static com.android.launcher3.Utilities.getDevicePrefs;
 import static com.android.launcher3.Utilities.getPointString;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_FOUR_COLUMNS;
 import static com.android.launcher3.config.FeatureFlags.ENABLE_TWO_PANEL_HOME;
 import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
 import static com.android.launcher3.util.PackageManagerHelper.getPackageFilter;
@@ -245,9 +244,6 @@
         if (ENABLE_TWO_PANEL_HOME.get()) {
             return ENABLE_TWO_PANEL_HOME.key;
         }
-        if (ENABLE_FOUR_COLUMNS.get()) {
-            return ENABLE_FOUR_COLUMNS.key;
-        }
         return Utilities.isGridOptionsEnabled(context)
                 ? Utilities.getPrefs(context).getString(KEY_IDP_GRID_NAME, null) : null;
     }
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 4754558..11585f9 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -17,9 +17,6 @@
 package com.android.launcher3;
 
 import static com.android.launcher3.InvariantDeviceProfile.CHANGE_FLAG_ICON_PARAMS;
-import static com.android.launcher3.InvariantDeviceProfile.KEY_MIGRATION_SRC_HOTSEAT_COUNT;
-import static com.android.launcher3.InvariantDeviceProfile.KEY_MIGRATION_SRC_WORKSPACE_SIZE;
-import static com.android.launcher3.config.FeatureFlags.ENABLE_FOUR_COLUMNS;
 import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
 import static com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI;
 
@@ -126,33 +123,6 @@
 
         mInvariantDeviceProfile = InvariantDeviceProfile.INSTANCE.get(context);
 
-        // b/175329686 Temporary logic to gracefully migrate group of users to the new 4x5 grid.
-        String gridName = InvariantDeviceProfile.getCurrentGridName(context);
-        if (ENABLE_FOUR_COLUMNS.get()
-                || "reasonable".equals(gridName)
-                || ENABLE_FOUR_COLUMNS.key.equals(gridName)) {
-            // Reset flag and remove it from developer options to prevent it from being enabled
-            // again.
-            ENABLE_FOUR_COLUMNS.reset(context);
-            FeatureFlags.removeFlag(ENABLE_FOUR_COLUMNS);
-
-            // Force migration code to run
-            Utilities.getPrefs(context).edit()
-                    .remove(KEY_MIGRATION_SRC_HOTSEAT_COUNT)
-                    .remove(KEY_MIGRATION_SRC_WORKSPACE_SIZE)
-                    .apply();
-
-            // We make an empty call here to ensure the database is created with the old IDP grid,
-            // so that when we set the new grid the migration can proceeds as expected.
-            LauncherSettings.Settings.call(context.getContentResolver(), "");
-
-            String newGridName = "practical";
-            Utilities.getPrefs(mContext).edit().putString("idp_grid_name", newGridName).commit();
-            mInvariantDeviceProfile.setCurrentGrid(context, "practical");
-        } else {
-            FeatureFlags.removeFlag(ENABLE_FOUR_COLUMNS);
-        }
-
         mIconCache = new IconCache(mContext, mInvariantDeviceProfile, iconCacheFileName);
         mWidgetCache = new WidgetPreviewLoader(mContext, mIconCache);
         mModel = new LauncherModel(context, this, mIconCache, new AppFilter(mContext));
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 6331ef2..81c841c 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -191,10 +191,6 @@
             "EXPANDED_SMARTSPACE", false, "Expands smartspace height to two rows. "
               + "Any apps occupying the first row will be removed from workspace.");
 
-    public static final DeviceFlag ENABLE_FOUR_COLUMNS = new DeviceFlag(
-            "ENABLE_FOUR_COLUMNS", false, "Uses 4 columns in launcher grid."
-            + "Warning: This will permanently alter your home screen items and is not reversible.");
-
     // TODO: b/172467144 Remove ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE feature flag.
     public static final BooleanFlag ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE = new DeviceFlag(
             "ENABLE_LAUNCHER_ACTIVITY_THEME_CROSSFADE", false, "Enables a "
@@ -234,12 +230,6 @@
         }
     }
 
-    public static void removeFlag(DebugFlag flag) {
-        synchronized (sDebugFlags) {
-            sDebugFlags.remove(flag);
-        }
-    }
-
     static List<DebugFlag> getDebugFlags() {
         synchronized (sDebugFlags) {
             return new ArrayList<>(sDebugFlags);
@@ -317,15 +307,6 @@
                     .getBoolean(key, defaultValue);
         }
 
-        /**
-         * Resets value to default value.
-         */
-        public void reset(Context context) {
-            mCurrentValue = defaultValue;
-            context.getSharedPreferences(FLAGS_PREF_NAME, Context.MODE_PRIVATE)
-                    .edit().putBoolean(key, defaultValue).apply();
-        }
-
         @Override
         protected StringBuilder appendProps(StringBuilder src) {
             return super.appendProps(src).append(", mCurrentValue=").append(mCurrentValue);
