Frequent bloggers will often need to create internal links from one WordPress post to another. The easiest way is to select the desired URL from the Insert/edit link tool within TinyMCE or Gutenburg Blocks.
However, a more flexible way is to reference the most canonical attribute of the content you create – the Post id.
The simplest way to find the id is to edit the post you want to link to. Once on the page or post you’d like to link to, make a note of the id listed in the URL.
Take the id (152 in the example below) and transpose it into the following link structure.
You now have a simple link that will find the post based on its id.
You can also append Custom Parameters or Anchor Tags to the end of the link URL as you’d expect.
This isn’t the most SEO-friendly way of creating internal links in your site, but it may be helpful when the permalink structure of the site could change in the future.
Be wary of using this method in cases where the site’s posts might be migrated to a different website using WordPress’ import/export tool as new, sequential Post ids will be created for the freshly imported posts. However, the site’s id structure should remain intact if the entire site is being migrated via ftp or plugin.