Skip to content

entity:save

11.0+

Re-save entities, and publish/unpublish is specified.

If passing in a file with an ID in each line, append a comma to each row.

Examples

  • drush entity:save node --bundle=article. Re-save all article entities.
  • drush entity:save shortcut --unpublish --state=draft. Unpublish and transition all shortcut entities.
  • drush entity:save node 22,24. Re-save nodes 22 and 24.
  • cat /path/to/ids.csv | drush entity:save node -. Re-save the nodes whose Ids are listed in ids.csv.
  • drush entity:save node --exclude=9,14,81. Re-save all nodes except node 9, 14 and 81.
  • drush entity:save user. Re-save all users.
  • drush entity:save node --chunks=5. Re-save all node entities in steps of 5.

Arguments

  • entity_type. An entity machine name.
  • [ids]. A comma delimited list of Ids. The list is read from Stdin if a value of - is provided for this option.

Options

  • --bundle=BUNDLE. Restrict to the specified bundle. Ignored when ids is specified.
  • --exclude=EXCLUDE. Exclude certain entities. Ignored when ids is specified.
  • --chunks[=CHUNKS]. Define how many entities will be loaded in the same step. [default: 50]
  • --publish. Publish entities as they are saved.
  • --unpublish. Unpublish entities as they are saved.
  • --state=STATE. Transition entities to the specified Content Moderation state. Do not pass --publish or --unpublish since the transition state determines handles publishing.

Global Options

  • -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
  • -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
  • -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
  • To see all global options, run drush topic and pick the first choice.

Aliases

  • esav
  • entity-save

Legend

  • An argument or option with square brackets is optional.
  • Any default value is listed at end of arg/option description.
  • An ellipsis indicates that an argument accepts multiple values separated by a space.