WordPress Frontend and Backend
A WordPress site has two sides: the frontend and the backend. It is important to know both, because you will always switch between them.
The WordPress frontend
The frontend is the public website. It is what your visitors see: the home page, blog posts, pages, menus, sidebar and footer. Its look comes from the active theme.
$ curl -s http://example.com/ | grep -o "<title>[^<]*</title>"
<title>Demo Site</title>
$ curl -s http://example.com/hello-world/ | grep -o "<h1[^>]*>[^<]*</h1>"
<h1 class="wp-block-post-title">Hello world!</h1>
The first command shows the title of the home page, and the second shows the heading of the Hello world! post that comes with a fresh install. Anyone on the internet can open these pages.
The WordPress backend
The backend is the admin area, also called the Dashboard or wp-admin. Only logged in users can open it. Here you add posts, change themes, install plugins and manage users. A user sees only the menu items which his role allows.
| Point | Frontend | Backend |
|---|---|---|
| Who uses it | Visitors | Admin, editors, authors and other users |
| Default address | https://example.com/ | https://example.com/wp-admin/ |
| Login needed | No | Yes |
| Purpose | Show the content | Create and manage the content and settings |
If you open the admin address without logging in, WordPress sends you to the login page:
$ curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" http://example.com/wp-admin/
302 http://example.com/wp-login.php?redirect_to=http%3A%2F%2Fexample.com%2Fwp-admin%2F&reauth=1
Moving between the two
When you are logged in, WordPress shows a black admin bar at the top of the frontend. It has the links to add a new post, edit the current page and go to the dashboard. In the backend, click the site name at the top left to see your frontend.
| Exercises & Assignments |
|---|
| No Content Found. |