Title: Permalink Post_name
Last modified: June 9, 2018

---

# Permalink Post_name

 *  [boffice](https://wordpress.org/support/users/boffice/)
 * (@boffice)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/permalink-post_name/)
 * Hello,
 * I have migrated from DLE (Data Life Engine) to WordPress. one of the guidelines
   was to keep the same urls as on the old website:
    my permalink config in word
   press: /%post_id%-%postname%.html
 * Example of url:
    [http://mywebsite.com/1148&#8211](http://mywebsite.com/1148&#8211);.
   html where: post_id= ‘1148’ and post_name=’-‘
 * but somehow WordPress doesn’t allow ‘-‘ digit in the end and automatically adds‘
   2’ as final digit
    so my output from post menu in dashboard looks like this. 
   [http://mywebsite.com/1148&#8211](http://mywebsite.com/1148&#8211);**2**.html
   and there is a conflict between MySQL entire and WordPress config, which leads
   to error page while trying to open the post.
 * p.s.
 * also i was wondering if there is any chance to automatically set featured image
   from first url in post_content ?

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/permalink-post_name/#post-10392604)
 * Yeah, permalink slugs cannot end with a hyphen. It’s not feasible to alter this
   restriction.
 * Are the URLs you want to maintain all in the form `####-.html`? The number of
   digits may vary, but generally an integer followed by `-.html`? There is validity
   to maintaining the same URLs, but the advantages can be gained through other 
   means. This could be an opportunity to migrate to more meaningful URLs. Go from
   _example.com/1148-.html_ to _example.com/creating-good-urls/_.
 * For a limited number of pages, this is feasible by adding a series of redirect
   rules to .htaccess. By redirecting with 301 status, any accumulated page rank
   associated with the old URL should eventually transfer to the new page.
 * For a huge number of pages you will need a more formulaic solution, custom redirects
   become too cumbersome. The simplest would be to add an .htaccess redirect rule
   that strips the -.html portion off so the new URLs are simply like _example.com/
   1234/_. Again, redirecting with 301 status will transfer page rank.
 * The featured image can be set by code when the page is updated by adding the 
   attachment ID to the post meta key `_thumbnail_id`. Thus code would need to extract
   the image URL from page content, then find that URL in post data to determine
   the related attachment ID.

Viewing 1 replies (of 1 total)

The topic ‘Permalink Post_name’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/permalink-post_name/#post-10392604)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
