Recreating Pinterest or TikTok Algorithm with Recommended Posts
Modern platforms such as Pinterest, Instagram, and TikTok are known for their algorithms that promote posts similar to those you have opened or liked. The same logic can be implemented on the WordPress site using the JetEngine's Query Builder and Data Store modules.
Before you start, check the tutorial requirements:
- JetEngine plugin installed and activated, with User Profile set up.
Create a Data Store
The system’s logic will be built on the Data Store principle. To build a new Data Store, move to WordPress Dashboard > JetEngine > JetEngine > Data Stores and click the “+ New Store” button.
Enter the store’s Name and Slug (“Favourite Jobs” in our case). Select the “User Metadata” Store Type and set the needed Max size. We also enable the Count items toggle.
Click the “Save” button.
Adjust a Terms Query
Proceed to WordPress Dashboard > JetEngine > Query Builder and click the “Add New” button.
Enter the Name for the query and select the “Terms Query” Type.
Select the required Taxonomy. In the Object/Post IDs field, choose the “Get store” option after clicking the “Dynamic Tag” icon, and in the newly opened pop-up, select the Data Store you created. Click the “Apply” button.
Save the query once you are ready.
Set up a Posts Query
Now, create one more query. Enter the Name and select the “Posts Query” Type.
Select the needed Post Type and choose the “Published (publish)” Post Status.
Proceed to the Tax Query tab and click the “Add new” button. For the Taxonomy field, select the same taxonomy you used in the previous “Terms Query”. Choose the “Term ID” option in the Field input.
Click the “Dynamic Tag” next to the Terms field and select the “Query Results” option. In the newly opened pop-up, select the “Terms Query” you created earlier for the Query field, and choose the “List of items IDs” option for the Return input. Click the “Apply” button. Put the “IN” option for the Compare operator.
Now, move to the Post & Page tab and choose the “Get store” option in the Post Not In field. Select the Data Store created in the first step and click the “Apply” button.
Open the Pagination tab and in the Posts Per Page field set the desired number of posts shown on the page at once. If you need to show all available posts, set the value to “-1”.
Save the changes once you are ready.
Create a Listing Template
Following the How to Create a Listing Template for Post Types in Elementor guide, we create a Listing Template that displays the recommended posts.
An essential element in this listing is a Data Store Button widget. As an alternative, the Dynamic Link widget can be used for our purpose. In this case, select the “Add to store” Source and set the required store. In our example, we also added the heart-shaped icon and set the Labels.
Click the “Publish” button once you are ready with the settings.
Add the Recommended Posts to the Profile Page
In this case, our aim is to display the recommended posts on the user’s Profile page. So, we open the Account Page template.
Add the Listing Grid widget to the template opened in editing mode. In the Listing dropdown, select the Listing Template you created earlier. Add any other needed settings.
In the Custom Query tab, enable the Use Custom Query toggle and select the “Posts Query” you created earlier.
Click the “Publish” button.
Check the Results
That’s it. Now you know how to recreate the Pinterest or TikTok logic, and display recommended posts from the same category, as users liked using the WordPress JetEngine plugin.











