Save failed with the following error: Null primary key not allowed

Joomla error Null primary key not allowed

The name of this blog post in an error message that some people say on their Joomla site. This error can occur when you click "Save" inside your site:

Save failed with the following error: Null primary key not allowed

This error will prevent you from saving the changes you've made. Fortunately, this error is usually fixable through one of these two solutions:


Solution #1. Fix asset issues

One cause of this problem is the #__assets table that was added to Joomla in version 1.6. This table can sometimes become corrupted. To solve this problem, the Joomla team added a way to fix the issue.

  • Go to Content > Categories. Select all menus items. Click the "Rebuild" button.
  • On the Content > Categories screen, open all the categories one-by-one and save them.
  • Go to Content > Articles. Select all artuicles. Click the "Rebuild" button.

rebuild Joomla assets

If this sounds like too much hard work, I highly recommend the ACL Manager extension. This has an option to fix all of Joomla's assets issues with just one click.

ACL Manager and Joomla asset issues


Solution #2. Check your plugins

Sometimes this error can be caused by a troublesome plugin. This will be a "Content" or a "System" plugin. One of the sites we tested, the culprit turned out to be a plugin left over from Joomla 2.5. This plugin provided a versioning system, but Joomla 3 has it's own versioning system.

Joomla system plugin

  • Go to Extension > Plugin.
  • Use the filter to search for either "Content" or "Systems" plugins.
  • Try disabling those plugins one-by-one to see if the error is fixed:

Joomla content plugin


About the author

Steve is the CEO of Joomlashack. Originally from the UK, he now lives in Sarasota in the USA. Steve has been involved with Joomla since 2006.