Custom Wordpress Plugin will install new and not update

I've just created my first custom Wordpress plugin. Now I want to push a new version:

Recreation Steps:

  • Install v1.1.0
  • Activate v1.1.0
  • See that is doing stuff - YEAH
  • Create new Zip with v1.1.2 and inside set Version: 1.1.2
  • Go to Wordpress - Add New and pick that zip
  • Wordpress will install new plugin and not ask to overwrite...

Can someone explain to me what I'm doing wrong?

Kind Regards, Ben

Topic plugin-development updates Wordpress

Category Web


A plugin is treated as the same as another plugin if it has the same directory name. That's it. If your zip file contains the plugin files then the zip filename will be used as the directory name. If your zip has a directory in it, containing the plugin files, then that will be used as the plugin directory.

So the solution is to structure your zips like this:

my-plugin-1.0.0.zip
    ∟ my-plugin/
        ∟ my-plugin.php

my-plugin-1.1.0.zip
    ∟ my-plugin/
        ∟ my-plugin.php

This way the directory will always be my-plugin/ and those two zips will be treated as the same plugin.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.