---
title: "How Can I Show Only the Logged-in User’s Data in wpDataTables?"
description: "Pre-filter your table so each user sees only their own rows — whether it's editable or not."
url: https://help.wpdatatables.com/en/articles/9-how-can-i-show-only-the-logged-in-user-s-data-in-wpdatatables
collection: "Advanced filtering"
updated: 2026-10-18
language: en
---

# How Can I Show Only the Logged-in User’s Data in wpDataTables?

Pre-filter your table so each user sees only their own rows — whether it's editable or not.

If you want to show only rows related to the currently logged-in user, there are two possible approaches depending on your table type:

### ✅ For [editable tables](https://wpdatatables.com/documentation/front-end-editing/creating-editable-tables/)

You can use our built-in feature that lets users **see and edit only their own data**.  
Just follow this guide:  
👉 [https://wpdatatables.com/documentation/front-end-editing/allowing-users-to-edit-only-their-own-data/](https://wpdatatables.com/documentation/front-end-editing/allowing-users-to-edit-only-their-own-data/)

This will automatically filter the table for each user’s `user ID` behind the scenes.

* * *

### 🔧 For non-editable tables

If your table is not editable (e.g., based on a Google Sheet, Excel, or similar), there’s a simple workaround using a placeholder:

### Step 1: Add a `user_id` Column

First, edit your source (e.g., Google Sheet or Excel) and add a column named `user_id`.  
Populate this column so that each row is associated with the relevant user’s WordPress user ID.

* * *

### Step 2: Set Filter Type to Text & Use Placeholder

In wpDataTables, edit the column settings for `user_id` and:

-   Set the **Filter type** to **Text**
    
-   Add a **Predefined filter value** using the placeholder: `%CURRENT_USER_ID%`
    

![](https://staticfiles.gleap.io/attachments/20250808153516_7968.png)

Here’s how the table looks before any filter is applied — all rows are visible.

![](https://staticfiles.gleap.io/attachments/20250808153516_5327.png)

And now, when the pre-filter is active, and the **Administrator is logged in** (user ID = 1 in this example), only the rows matching that user ID are shown.

![](https://staticfiles.gleap.io/attachments/20250808153516_1758.png)

💡 Need more details on placeholders?  
Check out our documentation here:  
[Using Placeholders in wpDataTables](https://wpdatatables.com/documentation/table-features/using-placeholders/)

* * *

### Hide the Filter Field from Front-End (Optional)

Even though the filter works, the `user_id` filter input is still visible on the front-end. If someone manually clears or changes it, they could potentially see all rows.

To prevent this, we’ll hide the filter field using custom CSS.

1.  Open the **Customize** tab in your table settings.
    
2.  Use your browser's **Inspect Element** tool to find the correct selector.
    
3.  Add custom CSS like this:
    

```javascript
#table_1_5_filter_sections {
    display: none;
}
```

![](https://staticfiles.gleap.io/attachments/20250808153516_5918.png)

* * *

Now, the `user_id` filter is hidden on the front-end.

![](https://staticfiles.gleap.io/attachments/20250808153516_8969.png)

### (Optional) Hide the `user_id` Column

If you'd also like to hide the `user_id` column from front-end users:

-   Either disable it from the **Column settings**
    
-   Or use the **Column list** button from the backend to toggle visibility
    
    ![](https://staticfiles.gleap.io/attachments/20250808153516_6259.png)
    
    That’s it! If you have any questions, feel free to [reach out](https://help.wpdatatables.com/en/articles/39-how-to-contact-support-with-your-premium-license.md) to our Support.
