Programmatically / by Rules, remove reference of a deleted user from contents created by that user. A user [content_editor] got deleted and the content created by this user is referring to anonymous user.  While an administrator is editing that content, administrator is receiving user doesn't exist. The error goes off when we re-assign the content to administrator or an existing user. As the user has created paragraphs, nodes etc how do we track contents created and referred by the user as user id is already deleted?

How can we remove these references and save the content without error message. 

I thought we can use Rules API to create a simple rule which will force save any entity if an admin is saving the content, then save the content. But the rules API is providing me only nodes and not entities which means paragraphs will still refer to old deleted user. How can I overcome this. Is there a programmatic solution to this problem?
supposing the content you want to reassign is of node type, here is how to do it programatically (in a hook_update_N() per example or /devel/php or drush ev...)

  $deleted_uid = 42;
  $reassigned_uid = 80;
  // Reassign nodes (current revisions).
  module_load_include('inc', 'node', 'node.admin');
  $nodes = \Drupal::entityQuery('node')
    -&gt;condition('uid', $deleted_uid)
    -&gt;execute();
  node_mass_update($nodes, ['uid' =&gt; $reassigned_uid], NULL, TRUE);
  // Reassign old revisions.
  db_update('node_field_revision')
    -&gt;fields(['uid' =&gt; $reassigned_uid])
    -&gt;condition('uid', $deleted_uid)
    -&gt;execute();


hope this helps