Yes, this is actually what WordPress does automatically for you.
Navigate to Settings>Permalinks and add your custom structure you want like:
/%postname%-%post_id%/
Related Posts:
- Open post-content in archive page in a Modal box with bootstrap
- create front-end users post list by specific category
- Trying to get post ID outside loop on blog page
- how to get page id of a page using page slug
- Disable Attachment Pages Completely
- Inject post (from specific category) between posts in Loop
- Remove option to allow trackbacks/pingbacks from post page options
- How to get year, month and hour in WordPress?
- Handling an Ajax form submit
- New Plugin Review
- Print number of post (in reverse)
- Use template for posts with a particular category grandparent
- Count number of published posts by type
- How to retrieve the content (with a specific ID) via ajax by clicking a link tag
- Automatically generate Post/Page from searched Database item?
- get_users(…) only returns one user
- Get taxonomy terms only of the WP_Query current posts
- How to get 2 or multiple custom post types in wordpress functions.php
- Displaying a button on each post
- Hide post if matches current month and year
- Creating bulk posts with Youtube videos
- Automatically add custom CSS to new posts using a category template
- How Display Posts on category
- Getting a specific post values to another div or modal
- Displaying the last post on static homepage
- Unreadable pagination
- how do I get a specific post from a post with a subcategory in WP
- Automatically create child pages and grandchild pages when saving a (parent) page
- How can I add extra word in permalink when someone click download button?
- remove post that has no content
- Custom posts in different columns style
- How to show only subcategories in parent category not parent category?
- Which PHP page is the Default Posts Page
- WP Insert Post and then go to post
- Copy taxonomy terms from one post to another programmatically
- Get latest post from all categories except one
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Parse error: syntax error, unexpected end of file
- Help getting previously visited pages ID
- Load Posts on Click via Ajax into a DIV
- How to catch wordpress post ID when it’s published
- get_the_ID() in the footer returns wrong value
- Use post ID in functions.php file adminside
- echo esc_url( get_permalink($post->ID) + complete the ID’s url
- WordPress upload file size error even after raising php limits
- Displaying list of posts in category page
- How can I get “Previous” and “Next” to show in the navigation besides the links?
- Error display post thumbnails for previous and next post
- form $_post action value gets truncated after it passes through two forms
- How to pick “full/thumbnail” images in the loop?
- Saving a post ID to use in a form elsewhere on website
- Wp Query : Order by distance lat,lon
- remove specificly the last tag in all posts
- Pagination at category doesnt work with same name of page
- Add posts to custom table in database instead of wp_posts
- get value from get_post_meta then reuse it in another get_post_meta
- How to show categories and date on posts
- WordPress Post Block Element not properly parsed with the_content filter
- Give ID to divs inside the loop
- Build A Custom SQL Query for WordPress Search
- WordPress Custom Form – Getting Query Vars, Weird Glitch?
- How to Send Pingbacks for all Posts in WordPress?
- Display articles with a different template in the home page | Solved |
- How can I check if a post with a particular slug or title exists?
- WordPress sorting posts by date and title using a dropdown
- Query on a repeater date (acf)
- Trying to show the category of a post in the post display
- Trying to get property ‘ID’ and ‘post_author’ of non-object error
- Split post or page content in two or more columns
- Enqueue script only on child pages of custom post types
- Attach and retrive multiple pdf files to post or page
- How to get the url of the entry in which an image belongs
- Check the database for a postmeta field
- Send POST request to Flask app from functions.php file
- Get list of posts from attachment
- Send Notification after post published was working but stopped after the last WP update
- How to insert text into post based on category – via single.php file
- When working with a post, almost all wp_postmeta are deleted
- WordPress Single Post Pagination Numbered and Navigational
- Let user select the number of posts shown per page jquery error
- Add wp posts to cutom masonry grid
- Displaying POST content with HTML tags and all
- Generate random access token to a post page
- Displaying 3 Category Posts differently
- Pagination in WP Queries
- Add div after every 4 posts then every 2 posts for a responsive loop
- Only display notification on single post
- Get posts associated with media attachment
- Can’t put a hyperlink on Featured Post’s Image
- Passed variable gets undefined variable error on insert on next page
- WordPress get_post_meta issue
- Automatically create a loop for post ID
- Why does WP_Query show only the same post even with different categories and endwhile?
- Display pages from specific page template
- Query posts by custom fields (object post)
- How to display the date under the post title?
- Excerpt all post content Content Same Size without word cutting off
- Set post to draft if matching word is found in the post
- WooCommerce: write featured image dimensions to custom fields in product’
- transition_post_status hook, works – but not if the post is new