Create WordPress tables with user specific content

WP user specific content plugins

This article explains how to use our table plugins with the Advanced Access Manager plugin. It's perfect for creating tables that show different content to each user - also known as WordPress user specific content.

At Barn2, we create plugins that list content from your WordPress website in a searchable, sortable table. This might be blog posts, pages, documents, or any other post type. Our table plugins are:

But what if you want each user to see different items in the table? Well, that's when you need to use our plugins with Advanced Access Manager.

Keep reading to learn how to create an interactive table with user specific content. I'll also reveal how to hide your entire table so that only certain people can see it.

Why would I want to list WordPress user specific content?

There are lots of reasons why you'd want to create a WordPress table with user-specific content. For example:

You can do all this and more by combining our table plugins with Advanced Access Manager.

Creating user specific content with Advanced Access Manager

Advanced Access Manager has a surprising number of features for a free WordPress plugin. It comes with several ways to control access to WordPress content:

  • Create role-specific content that only specific logged in user roles can see.
  • Protect user-specific content that only named logged in user accounts can access.
  • Choose whether or not visits (i.e. guest users) can see the content.

For each option, you can choose what appears for people without the correct privileges. You can hide the information completely, restrict it so that only people with the direct URL can see it, or display a custom message. You can restrict the ability to add comments, redirect people to another page, or password protect the content. It's even possible to add an expiration date so that the user's access automatically expires at a future date.

How to control access to pages, posts & custom post types

WordPress access control plugin

  1. First, install the free or pro version of the Advanced Access Manager WordPress plugin.
  2. When you add or edit a page, post or custom post type, you'll find a new 'Access Manager' section.
  3. On the left, there are tabs for the different protection options. These let you create user role specific content, user specific content, as well as choosing what happens for guests.
  4. On the right, choose one or more access restriction settings. (More on this in the next section.)

How does it work with Barn2's table plugins?

So far, I've told you how to create WordPress user specific content with Advanced Access Manager. Next, I'll reveal how each restriction option works when you list your WP content in a table with our table plugins:

  • List - Hides user specific content from public areas, while remaining available to anyone with the direct URL. Restricted items are hidden from your tables for unauthorized users. Users with the correct role or login can see them in the table.
  • Read - Lists protected content as usual, but unauthorized users will see an 'Access denied' message when they try to access the page. Content is listed for all users in the table but unauthorized users cannot access the single post page.
  • Limit - Not recommended, as the teaser message will not appear in the table.
  • Read Counter - Restricts how many people can access the restricted content. The restriction only applies when people click on a link in the table to access the single post page. The post/document/product still appears in the table after the limit has been reached.
  • Comment - Restricts who can comment on the single post page.
  • Redirect - Redirects unauthorized users to your chosen URL if they try to access the single page/post/document/product.
  • Password Protected - Password protects the page/post so that only people with the password can access it. It is still listed in the table as usual. Most of the columns in the table will appear for everyone, but information in the content column is hidden. A password login form appears in the content column so that users can enter the password directly into the table and reveal the hidden content.
  • Access Expiration - Choose a date when the content will expire and people can no longer access the single post page.

Combining the access restrictions

You can combine the above options to create more complex rules for your WordPress user specific content.

For example, you can combine the 'List' and 'Password Protected' options to hide information from the table and require a password when someone tries to access the direct URL to the protected content.

Can I show different information in the table columns to different users?

Yes, you can do this with the Advanced Access Manager shortcodes. Create a column in the table as usual (e.g. a custom field column), and add Advanced Access Manager shortcodes to this field. You'll need to add a separate shortcode for each group of users who needs to see different content.

For example, you might be listing ebooks in a table and want to add a 'Register' button for visitors and a 'Download' button for logged in users. You can do this by adding both buttons to a field in your table. Wrap one in a shortcode that is only visible to visitors; and wrap the other in a shortcode that is only visible to logged in users.

If you use this option, make sure you disable the caching option and enable the 'Shortcodes' option on the table plugin settings page. You must also disable the lazy load option in the Barn2 table plugin because the shortcodes only work when lazy load is inactive.

Please note that AAM has a 'Message' option in its shortcodes which lets you specify a message that appears to users without access to the content of the shortcode. This does not work with our table plugins - the column will simply appear blank to unauthorized users, with no message. Instead, you need to add multiple shortcodes - one for each user group.

I want to restrict entire categories, not individual posts

The free version of Advanced Access Manager forces you to create user specific content on a per-post basis. There are a few choices for restricting access to entire categories:

Can I hide my entire table at once?

By now, you've learned how to list posts, pages or custom post types in a table with user specific access restrictions. Each user sees different information in the table - or can access different links from the table - depending on the restrictions.

If you prefer, you can hide the page containing your table instead. Simply use the 'Access Manager' controls at the bottom of the page where you're using our table plugin. This will hide the entire page - including the table - from non-authorized users.

Can I sell access to members-only content?

Yes, the Pro version of WP Advanced Access Manager has this feature. It lets you sell access to exclusive content. You can then restrict certain pages/posts/custom posts so that only people who have purchased access can view it in the table.

Does it work with other WordPress membership plugins?

There are dozens of WordPress membership plugins available, and we can't realistically test with all of them. The other one that we have tested with is Groups, which also works nicely with our table plugins.

With Groups, you have to create a 'group' (hence the name!) and add users to one or more groups. You can then restrict your content so that only logged in users in the correct group can see it. If you're listing content using our table plugins, then users will only see information that their group has access to.

We love Groups, but Advanced Access Manager is a simpler option for many people. This is because it lets you lock down content to specific user roles, so you don't have to bother creating groups and adding users to the correct group.

Do you use Barn2's table plugins with access restrictions?

If you want to add tables to your WordPress site which show different items to different users, then choose one of Barn2's table plugins and use it alongside Advanced Access Manager:

We'd love to hear how you use our table plugins to show different WordPress content to different types of user. Please add your comments below.

Please share your thoughts...

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