The term slug is used to refer to parts of a URL that consist of one or several words and can be read by search engines as well as by users. Typically, slugs are located at the end of a URL and uniquely direct to a digital resource by referencing it with a particular URL structure. A URL slug consists of natural language terms that clearly describe the content of the website. Depending on how URL slugs are generated, speaking URLs (also called: clean URL, semantic URL or pretty URL) and meaningful permalinks are the result.
The adaptation of slugs not only serves search engine optimization, but also users. The topic of the content can be quickly understood and, by deleting parts of the URL, you can easily change the levels in the information architecture or share the URL in social networks. The name slug originates from the publishing and media industry. Articles and news stories, which are being worked on and are supposed to be published, are called “slugs.” On the one hand this is intended to emphasize their work in progress characteristic; on the other hand, a keyword is meant to indicate the content of the article. Similar terms are also used in advertising campaigns and serials to name individual ads or posts. The CMS WordPress took over this language rule to describe individual content with URL slugs.
Since some content management systems (for example WordPress, Django or Typo3) do not use any speaking URLs by default, the URL slugs often have to be adapted. In WordPress, for example, posts always receive a standard identification number (short: ID), which refers to the respective post in the blog. The problem is that ID numbers do not make sense to either readers or search engines. Some URLs also show the technique used since file extensions and protocols indicate it.
In the following example, a post will get the URL Slug"?P=1234". The document can be unambiguously referenced, but references to the content are not given.
A URL slug, on the other hand, identifies a resource using human and machine-readable keywords separated by hyphens and derived from the title of the post. Typically, the system writes keywords in lower case. In WordPress, these specific URLs are called post slugs. They are generated automatically when appropriate settings have been made. Slugs can also be assigned to other types of resources, for example, categories, tags, and pages (subpages). An example:
The URL in this example is already a speaking URL. To create such URLs, you can modify the structure of the URL (custom permalink structure). The URL in the first example is resolved to show the category, the ID for the post, and the title of the post. To do this, webmasters will have to make some adjustments in the settings:
WordPress then normalizes each URL of a post according to the given schema. The system uses lowercase for each string, removes special characters that require URL encoding, and converts spaces. A hyphen is inserted between the words. The result is a talking URL whose last part, the URL slug, has been automatically changed. 
URL slugs are also relevant to other systems, especially those that dynamically generate content and websites. Moreover, the normalization of URLs is also important since diverse web servers are in use such as Apache, Nginx or ASP.NET]. Modules such as htaccess or rewrite engines (mod_rewrite) can be used to modify directory and URL structures to convert individual URLs into speaking URLs and redirects will take place on these resources.
For larger websites, regular expressions and bulk optimizations are used in order to implement the changes more effectively. By setting up an information architecture, topics and special keywords can also be covered. Typically, the converted URLs do not conflict with other resources on the same site, otherwise duplicate content could result.
URL slugs are displayed by search engines. In the SERPs, they are shown below the site title (meta title) in green. The keyword or keyword combinations searched by users are marked in bold if they are in the URL. This allows users to see at a glance whether the information resource contains the desired information. Probably Google does not just consider the entire URL as a ranking signal, but also parts of it. Therefore, it would be wise to change URLs so that they are search engine-compliant from an SEO perspective.
This means, however, that any forwarding to canonical URLs and redirects need to be put in place since the old URLs should not be de-indexed. That way, the link juice is passed on to the “new” resources. Another important aspect is that users get signals concerning the content through specific URL slugs. Choosing a speaking URL can have a significant impact on click rates and generate more traffic.
In principle, the URL structure should be based on clear, speaking, but also short names, in order to simplify the handling of the information resource both for search engines and readers. However, when converting to search engine friendly URLs (short: sef URL), it is important to keep in mind the following points. And such a conversion should be done for the long term so that the evergreen content can still be used as link targets by other websites years later.