Answers.Body: <p>Seems like a good case for a <a href="https://pluginfactory.io" rel="nofollow noreferrer">simple plugin</a> that listened to the <a href="https://craftcms.com/docs/plugins/events-reference#entries-onBeforeSaveEntry" rel="nofollow noreferrer"><code>onBeforeSaveEntry</code></a> event.</p>
  
  <p>That plugin could verify the entry is in the section you're looking for, compare the existing slug against any saved in the database and do whatever you want to do from there (set it null, etc.).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-11T14:42:36.593Z
Answers.Text: Thank you, I've created a simple plugin that writes the slug always new when an entry is saved. Works perfect.
Answers.UserDisplayName: MISC
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-09T17:46:29.110Z
Answers.LastActivityDate: 2017-05-09T17:46:29.110Z
Answers.UserDisplayName: Brad Bell
Body: <p>I have a channel, where entries do NOT have their own URLs. But a slug is created automatically every time I save an entry. And I have auto-generated titles.</p>
  
  <p>Often I save an existing entry as a new entry and just change something which changes then my auto-generated titles also. But the slug does not change (only a number is added).</p>
  
  <p>Now my problem: The search function also searches the slug what then results in wrong search results.</p>
  
  <p>My question: The only solution I've found is to manually delete the existing slug and to save the entry again. Is the a better solution for my problem?</p>
  
  <p>Thank you very much for your help!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-09T16:07:10.540Z
Comments.Text: Have you tried to change the search term options and to exclude (only include other attributes) the slug? https://craftcms.com/docs/config-settings#defaultSearchTermOptions
  
  This way you don't have to work around the search.
Comments.UserDisplayName: Max Strebel
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-11T08:32:26.103Z
Comments.Text: Thank you. But this would only work in the front-end, but not in the back-end.
Comments.UserDisplayName: MISC
Tags: <slug><entry-slug>
Title: How to change the Slug in case of copied entries?
ThreadText: # How to change the Slug in case of copied entries?
  
  (Asked by: username_0 on 2017-05-09)
  
  I have a channel, where entries do NOT have their own URLs. But a slug is created automatically every time I save an entry. And I have auto-generated titles.
  
  Often I save an existing entry as a new entry and just change something which changes then my auto-generated titles also. But the slug does not change (only a number is added).
  
  Now my problem: The search function also searches the slug what then results in wrong search results.
  
  My question: The only solution I've found is to manually delete the existing slug and to save the entry again. Is the a better solution for my problem?
  
  Thank you very much for your help!
  
  **Tags:** slug, entry-slug
  
  > **Comments:**
  > **username_1**: Have you tried to change the search term options and to exclude (only include other attributes) the slug? https://craftcms.com/docs/config-settings#defaultSearchTermOptions  This way you don't have to work around the search.  
  > **username_0**: Thank you. But this would only work in the front-end, but not in the back-end.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-05-09. Score: 1 | Accepted answer
  
  Seems like a good case for a [simple plugin](https://pluginfactory.io) that listened to the [`onBeforeSaveEntry`](https://craftcms.com/docs/plugins/events-reference#entries-onBeforeSaveEntry) event.
  
  That plugin could verify the entry is in the section you're looking for, compare the existing slug against any saved in the database and do whatever you want to do from there (set it null, etc.).
  
  > **Comments:**
  > **username_0**: Thank you, I've created a simple plugin that writes the slug always new when an entry is saved. Works perfect.  
  
  ---
  
  