Top

Delete a Page


In Nuxt, pages are automatically generated from the app/pages/ folder. This means deleting a page is as simple as removing its file, and Nuxt will automatically remove the route for it.

There’s no CLI command to delete a page — it’s done manually. However, there are a few important steps to follow to ensure your project remains clean.

Removing a Page File:
  1. Delete the Page File:
    • Go to your project's pages folder.
    • Find the .vue file (or folder with an index.vue inside) corresponding to the page you want to remove.
    • Delete that file or folder.
  2. Remove Page Links:
    • Search your project for <NuxtLink> or navigateTo() calls that link to the deleted page.
    • Remove or update those links so they don’t point to a missing route.
      • Example link to remove:
        <NuxtLink to="/about">About Us</NuxtLink>
  3. Remove Dynamic Route References (if applicable):
    • If the deleted page was a dynamic route (e.g., app/pages/blog/[id].vue), make sure you remove any code that tries to navigate to it or fetch its data.
  4. Clean Up Sidebar/Menu:
    • If you had a menu or sidebar entry for this page, update your navigation configuration file or component to remove the link.

Warning: If your page was linked from the sidebar or header menu, leaving those links will cause a 404 Page Not Found error.