Home

postname

Postname is a placeholder tag used in WordPress permalinks that expands to the post slug in the final URL. It is one of the built-in rewrite tags recognized by WordPress when constructing a URL based on the site’s permalink structure. The most common use is in the permalink settings, where administrators can choose a structure that includes %postname% to place the post slug in the URL. For example: /blog/%year%/%postname%/ or /%category%/%postname%/.

The slug, stored in the wp_posts.post_name field, is generated from the post title by default and sanitized

When you update a permalink structure to include %postname%, existing posts continue to resolve to their current

The term postname is sometimes used interchangeably with slug or with the token %postname% in WordPress documentation.

to
lowercase
letters,
numbers,
and
hyphens.
Editors
can
edit
the
slug
in
the
publish
panel;
changing
the
slug
updates
the
value
of
post_name
and
thus
the
resolved
URL.
WordPress
enforces
uniqueness
of
post_name
within
a
post
type
to
avoid
URL
conflicts,
appending
a
suffix
like
-2
if
needed.
slugs
unless
redirected.
If
you
change
a
post’s
slug,
you
should
set
up
redirects
to
preserve
SEO.
Practical
considerations
include
avoiding
duplicate
slugs
across
posts
with
similar
titles
and
ensuring
readability.
It
is
a
core
aspect
of
WordPress
URL
routing
and
content
addressing.