Someday someone will write a book about the complexities of website addresses, permalinks, pretty permalinks, nonces, preview links, conditional links, and all of the other linky link links that WordPress uses. Until that authoritative text book is written, you are stuck with my weak explanations.
As you move through the various assignments in In Lorelle’s WordPress School free course, you will often encounter some odd addresses, pageviews, and posts and Pages that don’t change no matter how much you edit them.
This tutorial is about the structure of WordPress addresses and URLs, those seen on the front end of the site by readers, and those generated by WordPress on the backend and part of the editing process. Understanding how the various linking systems work in WordPress helps you navigate faster and more efficiently in WordPress.
Keeping this very simple, here are some of the things you need to know about how addresses or URLs work in WordPress.
First, some terminology.
Website Address Terminology
A website address is the parking spot on the web where your website parks. It represents the virtual address of your website. The address is also known as the URL, the Uniform Resource Identifier. It is string of numbers disguised as a web domain and web page address such as
The domain name is the nice name of that address. A domain name is purchased from a domain reseller like GoDaddy, WordPress.com, your web host, or any domain name seller. Domain names come with extensions like .com, .org, .net, .info, .me, and so on.
A subdomain is the part of a domain address that sits before the domain name such as
http://example.wordpress.com. Subdomains are either separate sites on the main domain or different departments, so to speak, of a company site such as
http://wordpress.allthingsweb.com representing the WordPress topics and specialists on a site covering a wide variety of topics about the web.
A permalink is a permanent link. It is a link to a specific web page. Blogs have a changeable front page, so linking to an article on the front page doesn’t mean the article will be there when the person follows the link to it. A permalink is the link to the never-changing address of the web page.
Pretty permalinks are the pretty names for permalinks. Originally, permalinks often consisted of a variable and the ID number of the web page such as
http://example.com/?p=12345. With a few clever bits of code in the
.htaccess file, these ugly links were turned pretty as
A nonce is the last word you need to know for this tutorial. The term “nonce” means “now once,” a number that is generated and used once in cryptographic programming languages. WordPress uses nonces to timestamp a post or Page in revisions.
WordPress Front End Address Basics
On the front end of WordPress, visitors see the permalinks, the permanent links to the generated web pages such as the About Page, Contact Page, front page, and post pageviews.
Without making changes to the permalink structure, WordPress generates links that look like this:
Broken down this represents the domain name and the post ID as a PHP code request to the database to generate that post.
WordPress.com and many self-hosted WordPress sites choose a pretty permalink structure that turns the permalink into dates and words, a more readable address.
This is a common format for a pretty permalink featuring the year, month, day, and post title:
The structure for Pages or Custom Post Types in WordPress are:
Note that the date is not included in the URL. This is because Pages exist outside of the reverse chronological order of the content.
Permalinks for categories and tags are structured in this format:
To share the link to a post or Page through social media or email, copy the address of the post or Page from the browser address bar.
To link to a post or Page on your site or off your site, copy the address of that specific post or Page from the browser address bar, not the front page, search results, category, or tag pageviews of the site. Get your reader to that specific article.
WordPress Administration Screen Addresses
The WordPress Administration panels do not use permalinks but the default PHP structure for links. It uses the file names and conditional addresses.
To log into WordPress, you would type:
This address leads to the
wp-login.php file to initiate the login process in WordPress.
Luckily for us, WordPress developers changed this not long ago so we only have to enter the pretty permalink of
https://example.com/login, which takes us to the same login screen, saving us a few keystrokes.
The Post panel in WordPress is at:
Edit a post and the URL changes to:
Let’s break this down.
||Server directory for the file|
||File to generate the Post Panel|
||PHP/WordPress request to edit post ID #2099|
||“and” edit the post (use the post edit panel)|
You will find these addresses throughout WordPress with various ID numbers and conditionals depending upon what you are doing.
These are links you are to not share with the general public. They are the access points to the backend of your site.
Preview Post/Page Links
When a post is previewed, a preview link is generated. This link can only be accessed when logged in. A Page-Not-Found error is generated when accessed by those not logged in or without user role permissions to allow access.
The format of the preview links is:
The conditional part of the link,
preview=true, allows viewing of the post when logged in, viewing it as a preview of the draft or pending post, not the published post because the post hasn’t been published.
If you are working with a fellow contributor, editor, or the site administrator on a multiple contributor site, you may use the front end preview link in an email to direct them to your draft post if you wish, reminding them they have to log in to view the post or Page. A better solution would be to use the WordPress.com and Jetpack WordPress Plugin feature called Feedback to send an email request to review your draft.
I Make Changes and They Do Not Appear on the Post/Page
When editing/updating a published post or Page, clicking the Preview button generates a link with a
WordPress uses nonces to protect URLs from being misused and to preserve post and Page revisions, but also to generate a single instance of a web page view such as a post or Page preview of a draft, scheduled, or published post. Think of the nonce as representing a fixed point in time, only for that moment. Thus, when previewing a published post, the post is published, thus “fixed” in time.
If you make changes to the post, update, go do something else for a bit and return, make changes to the post and switch to the preview tab already open, when you refresh the page, your changes will not be seen. The preview is locked to that nonce preview version.
Click the Preview link again to refresh the nonce version or remove the ampersand (&) and preview nonce to reduce the address back to the preview of the post or Page ID, and hit enter.
To avoid this issue when working on published posts, use the View Post button near the post title rather than the Preview button by right clicking on it and choosing to view the link in a new tab. The View Post button displays the actual link to the published post, not the preview link.
For More Information on URLs and Website Addresses in WordPress
For more information on website addresses and URLs, see:
- Uniform resource locator – Wikipedia
- Permalink – Wikipediaia
- Using Permalinks « WordPress Codex
- Settings Permalinks Screen « WordPress Codex
- Setting your WordPress Permalinks – Themify
- The Ultimate Guide to WordPress Permalinks – ManageWP
- How to change your WordPress Permalink Structure – Yoast
- A Guide To WordPress Permalinks, And Why You Should Never Use The Default Settings | Elegant Themes Blog
- A Simple Guide to Changing Your Permalinks Without Breaking Your WordPress Website – WPExplorer
- Rewriting URLs in WordPress: Tips and Plugins – HongKiat
- WordPress Nonces – WordPress Codex
- WordPress caching and nonce lifespan – Myatu’s
- WordPress 2.0.3: Nonces | Mark on WordPress
- A Brief Introduction to WordPress Nonces | Tips and Tricks HQ
This is a challenging assignment as we have to recreate something that you may or may not ever encounter. The goal of this assignment is to experience encountering a nonce in WordPress and learning how to handle it.
- Edit a published post in your test site
- Click the Preview Button
- Copy the address of the tab in the post preview. It should look something like:
Paste it into a text editor and do not close it or lose it. Save the file if you shut down your computer and remember where you put it.
- Wait 26 hours for part 2 of this assignment. Yes, over a day. This doesn’t mean do nothing. It means you may go on about whatever you were doing and leave the Edit Post screen and move onto something else.
- Just over 24+ hours later, if WordPress is cooperating this will work, this should work. Edit the published post again.
- Click the Preview Button
- Check the address of the tab in the post preview. Is the Preview ID and nonce numbers and characters the same or different from the first copied version?
- Edit the post. Change a little thing. Add a line or change a word. This is your test site, so don’t worry.
- Update the post and switch to the FIRST preview tab and refresh or paste in the first preview link you saved into a new tab. Do you see the changes?
- Edit the post with more changes and update. Switch to the first preview tab version of the post again and refresh the screen. See the changes?
If you can see the changes and the nonce is the same, it is likely that it hasn’t been long enough for the nonce settings to reset and change.
If you cannot see the changes, this is the nonce at work. Per the instructions above, remove the nonce references in the link back to the
preview_id=1234 and click enter to see the changes.
Sometimes the nonce lock happens faster than 24+ hours. I’ve had it happen with student, client, and my own WordPress sites within minutes of publishing a post then editing it several times. If anyone can explain why it works so fast, I’d love the step-by-step process to recreate it to teach others how to avoid it.
Next time you get caught on a published post or Page and are unable to see changes, this is what happens and you will learn how to fix this issue.
This is a tutorial from Lorelle’s WordPress School. For more information, and to join this free, year-long, online WordPress School, see:
- Lorelle’s WordPress School Introduction
- Lorelle’s WordPress School Description
- WordPress School Tutorials List
- WordPress School Google+ Community
- WordPress Publishing Checklist
- How to Give Feedback and Criticism