npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@frameless/strapi-plugin-old-slugs

v2.0.0

Published

This is a customField to store old slugs for content types

Readme

Strapi Plugin: strapi-plugin-old-slugs

⚠️ This plugin is compatible with Strapi v5 only.

A Strapi plugin that keeps track of previous slugs when they change in the CMS. It stores them in a JSON field called oldSlugs within the content type.

✨ Features

  • Automatically saves previous slugs when a slug field is updated.
  • Helps maintain URL history for redirects or SEO purposes.
  • Configurable to work with specific content types.

🚀 Installation

You can install the plugin using pnpm or npm:

# Using pnpm
pnpm add @frameless/strapi-plugin-old-slugs

# Using npm
npm install @frameless/strapi-plugin-old-slugs

🔧 Configuration

  1. Add the oldSlugs Field

    To store the previous slugs, you need to add a field of type JSON with the name oldSlugs in the content types where you want to track slug changes.

    Option 1: Using Strapi Content-Type Builder You can add the oldSlugs field using the Strapi Content-Type Builder in the Strapi Admin panel:

    1. Open your Strapi Dashboard.

    2. Navigate to Content-Type Builder.

    3. Select the content type you want to modify (e.g., Product).

    4. Add a new field with the following settings:

      • Field Name: oldSlugs

      • Type: JSON

    5. Save the changes and restart the server.

    For more details, refer to the Strapi Content-Type Builder documentation.

    Option 2: Editing the Model File Manually If you prefer, you can manually modify the model file.

    Path: src/api/product/content-types/product/schema.json

    {
      "kind": "collectionType",
      "collectionName": "products",
      "info": {
        "singularName": "product",
        "pluralName": "products",
        "displayName": "Product"
      },
      "options": {
        "draftAndPublish": true
      },
      "attributes": {
        "title": {
          "type": "string",
          "required": true
        },
        "slug": {
          "type": "string",
          "required": true,
          "unique": true
        },
        "oldSlugs": {
          "type": "json",
          "default": []
        }
      }
    }
  2. Enable and Configure the Plugin

    After installing the plugin, enable and configure it in your Strapi dashboard.

    1. Navigate to the configuration file: /config/plugins.ts (or /config/plugins.js if using JavaScript).
    2. Add the following configuration:
    export default ({ env }) => ({
      "old-slugs": {
        enabled: true,
        config: {
          contentTypes: [
            {
              uid: "api::product.product",
            },
          ],
        },
      },
    });

Configuration Options

| Option | Type | Description | | -------------- | ----- | ----------------------------------------------------------- | | contentTypes | Array | List of content types where slug history should be tracked. |

📌 Usage

Once enabled, the plugin will automatically store previous slugs in the oldSlugs JSON field of the specified content types whenever the slug changes.

Example of a product entry with old slugs:

{
  "id": 1,
  "title": "New Product Name",
  "slug": "new-product-name",
  "oldSlugs": ["old-product-name", "very-old-product-name"]
}

🛠️ Build the Strapi Dashboard

After configuring the plugin and updating the content type, you need to rebuild the Strapi dashboard for the changes to take effect.

Run the following command:

pnpm build && pnpm develop

Or if you're using npm:

npm run build && npm run develop

💡 Why Use This Plugin?

  • Ensures old slugs are not lost when URLs change.
  • Useful for setting up redirects or tracking changes.
  • Helps maintain SEO rankings by preserving URL history.

🔥 Contributing

Feel free to submit issues or pull requests to improve this plugin!

📜 License

This plugin is licensed under the EUPL License.