Stephanie Leary

Writer and WordPress consultant

  • Books
    • Content Strategy for WordPress (2015)
    • WordPress for Web Developers (2013)
    • Beginning WordPress 3 (2010)
  • Blog
    • Fascism Watch (2016-17)
    • Content Modeling for WordPress series
    • WordPress Hidden Gems series
  • Work
    • Portfolio
    • Services
    • WordPress Plugins
    • WordPress Themes
    • Presentations and Interviews
    • on GitHub →
  • About
    • Press Kit
  • Contact
    • Mailing List

Warning users not to edit the posts container page in WordPress

August 5, 2011 Stephanie Leary 6 Comments

I have this one user. You know the one; we all have one like her. Giving her the power to do things on her own is kind of pointless, because she can’t ever remember how to do them.

In particular, she can’t seem to retain the procedure for adding news to the site. She knows that to edit almost everything on the site, she goes to Pages. And since she sees a News page there, she clicks it, thinking that’s where the news goes. Of course, it isn’t. This site is set up to use a page for the front page, and the News page is the posts container.

But you know what? The WordPress UI is kind of unclear on this point, and if I have one user who calls me up because she can’t remember how to do this, I probably have twelve more who are just too frustrated and/or embarrassed to ask. So I put a warning on that page (and ONLY on that page) telling them to go to Posts instead of editing the page.

This is the code that went into functions.php:

// Admin Notice on Posts Page
add_action('admin_head-post.php', 'us2011_postspage_error_notice');
function us2011_postspage_error_notice() {
	$postspage = get_option('page_for_posts');
	if (!empty($postspage))
    	add_action('admin_notices', 'us2011_postspage_print_notices');
}
function us2011_postspage_print_notices() {
	$postspage = get_option('page_for_posts');
	// show this only if we're editing the posts page
	if (!empty($postspage) && isset($_GET['action']) && $_GET['action'] == 'edit' && $_GET['post'] == $postspage) 
		echo '<div class="error"><p>This page is a container for the most recent posts. It should always be empty, and you should never edit this page. To add a news item, go to <a href="post-new.php">Posts -- Add New</a>.<p></div>';
}

If that goes over well, I might dump it into the network’s mu-plugins directory instead.

WordPress

Comments

  1. Dougal Campbell says

    August 5, 2011 at 1:49 pm

    I have this one user. You know the one; we all have one like her.

    Oh, yeah. Many (many, many) moons ago, I worked at a place with a small office network. Everybody had a shared folder on their desktop. When we wrote reports (we did EPA compliance testing), we’d drop the finished documents in this folder, where one of the secretaries would retrieve it to do final error checking before printing and mailing it to the client.

    Once in a blue moon, Gretta would say, “What happened to all my files?” The reports would disappear from her shared folder (fortunately, we still had local copies, but she lost edits).

    After some investigation, we figured out what happened. Our salesman — let’s call him Dave — was poking around in his files. He saw a bunch of filenames he didn’t recognize and said, “These aren’t mine!” and he deleted them. Yes, he was having trouble understanding the concept of a shared network folder, and thought he was deleting errant files from his own computer.

    The thing is, that even after explaining this to him, he did it at least two more times! Finally, we simply disconnected Dave’s office from the network, and he had to use floppies to get files to the secretaries.

    Reply
    • Stephanie says

      August 5, 2011 at 1:50 pm

      … OMG.

      Reply
  2. Lew Ayotte says

    August 5, 2011 at 1:56 pm

    When setting up new sites for clients, that require magic like this. I do something similar, except I just stick it in the page content… like:

    [WARNING THIS IS A PLACEHOLDER PAGE … BLAH BLAH BLAH]

    Not as elegant as your trick.

    Lew

    Reply
  3. Ryan Imel says

    August 5, 2011 at 1:57 pm

    I like the idea Stephanie. I wonder if there wouldn’t be another, even more elegant solution. Perhaps a way to hide pages from non-admin users entirely (from the Dashboard, on the edit screen). That way they never even hit edit on something they shouldn’t.

    Just riffin’ here, something I might try in the future. Thanks for the thought :)

    Reply
    • Stephanie says

      August 5, 2011 at 2:05 pm

      Well, in this case, she IS supposed to edit pages. It’s a university site that consists of lots and lots of pages, with a few posts almost as an afterthought.

      Reply
  4. Chris says

    August 11, 2011 at 1:29 pm

    It’s probably a universal truth of CMS: code-reuse, shared-content, page-mirroring, internal-links. No matter what you call it, we all have content somewhere else that’s shared multiple places.
    Cascade is no different. We decided to make news available to all users. We set it up in a common directory outside of everyone’s site. In order to write an article they must first save it to the common directory and then make a page on their site that points to the article.
    After a couple hand-holding sessions we wrote down the procedure on another website. If they forget we tell them RTFM.

    Reply

Leave a Reply to Stephanie Cancel reply

Your email address will not be published. Required fields are marked *

Fascism Watch

The Fascism Watch is a daily(ish) news roundup. View all the previous Fascism Watch posts »

Latest WordPress Book

Content Strategy for WordPress

A short book for content strategists and managers on implementing a complete content strategy in WordPress: evaluation, analysis, content modeling, editing and workflows, and long-term planning and maintenance.

Read the sample chapter

Kindle Nook iBooks Kobo Smashwords

WordPress for Web Developers

WordPress for Web Developers (9781430258667)

This is a book for professional web designers and developers who already know HTML and CSS, and want to learn to build sites with WordPress. The book begins with a detailed tour of the administration screens and settings, then digs into server-side topics like performance and security. The second half of the book is devoted to development: learning to build WordPress themes and plugins.

This is the second, much-revised and updated edition of Beginning WordPress 3, with a more accurate title. Everything’s been updated for WordPress 3.6.

WordPress for Web Developers is out now. See what's inside...

The best WordPress features you’ve never noticed

  • WordPress Hidden Gems: Screen Options
  • WordPress Hidden Gems: Bulk Edit
  • WordPress Hidden Gems: Private Status
  • WordPress Hidden Gems: Dashboard Feed Readers
  • WordPress Hidden Gems: Options.php

Content Modeling for WordPress series

  • Content modeling for WordPress, part 1: analyze content
  • Content modeling for WordPress, part 2: functional and organizational requirements
  • Content modeling for WordPress, part 3: a sample content model

This is an excerpt from Content Strategy for WordPress.My latest books are Content Strategy for WordPress (2015) and WordPress for Web Developers (2013). Sign up to be notified when I have a new book for you.

Copyright © 2021 Stephanie Leary