Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Allow Users to Add Favorite Posts in WordPress

Last updated on by
Follow WPBeginner on YouTube
How to Allow Users to Add Favorite Posts in WordPress

Have you ever wanted to create a personalized experience for your users on your WordPress site? One way of doing this is by allowing them to have a personalized library or favorite posts area. Recently, while working on a membership site for a client, we found a need to create “personalized library” of videos for the users. This way, they can watch them again and again. It also allowed us to show them personalized results on a custom user dashboard which they saw when they logged in. In this article, we will show you how to allow users to add favorite posts in WordPress when they are logged in. We will also show you how to allow users to add favorite posts in WordPress when they are NOT logged in.

First thing you need to do is install and activate the plugin WP Favorite Posts (At the time of writing this, the plugin’s page says 50% of users say it is broken, but we have tested it out and it works).

This plugin allows users to add favorite posts. It uses cookies and database for saving data. If a user is logged in, then favorites data will be saved in database instead of cookies. If a user is NOT logged in, then the data will be saved in cookies.

Once you have activated the plugin, go to Settings » Favorite Posts. You will see a settings page like this:

WP Favorite Posts

Here you can select whether you want to have this for registered users only or not. You can select the image you want to show before the link. You can also choose to have Most Favorited Post Statistics enabled or not (Hint: you can use this in your sidebar to show Most Favorited Posts). You can also customize the labels which are pretty self explanatory.

Once you have saved all the settings, then simply add the following code in your theme files (single.php, page.php, index.php etc). Wherever you want to display the favorite option. Use the following code:

<?php if (function_exists('wpfp_link')) { wpfp_link(); } ?>

If you only want to allow the favorite post options on some pages, then you can use the short code, [wpfp-link].

If you want to display a page such as “My Library” or “Your Favorites” to create a personalized experience, then all you have to do is create a page and paste the following code: {{wp-favorite-posts}} and it will list all of user’s favorite posts.

We hope you like using this plugin. If you have any questions, then feel free to let us know.

Download WP Favorite Posts


Editorial Staff at WPBeginner is a team of WordPress lovers led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »
  • http://www.wpbeginner.com/ WPBeginner Staff

    It can, but you will have to make some changes to the plugin which we don’t recommend/

  • jimario

    Will this also work with user profiles. For example, i want my site to allow some users to be able to view a list of other viewers profile pages. On those pages, they won’t be able to edit the other users’ profiles, but they will be able to favorite them–at least that’s what I’m trying to accomplish. Will your method work?

    • http://www.wpbeginner.com/ WPBeginner Support

      No, we think you are looking for something quite different this method will probably not work for that.

  • jimario

    Is it possible to have user profiles also saved as favorites? If I give access to users to view profiles of other users, I’d like those users to be able to Favorite any other user profile that they view using this plugin. is this possible using the method you described in your article?

  • ALEXANDRA

    Hi, is there any way to create few sites for users, for example:
    – Add to favorites,
    -Add to currently reading,
    -Add to watchlist etc
    and create specific pages for all this options?

    • http://www.wpbeginner.com/ WPBeginner Support

      Yes it is possible to create profile pages with tabs where users can see their favorites, currently reading, watchlist, etc. However, if you want to do that we would recommend using a membership plugin.

  • Ayush

    Nice plugin and tip brother, I installed it and worked super-fine.

    And i was wondering if there’s a way I can show what posts a particular user favorites in user’s profile, I mean a user can indeed see what posts he/she likes but is there a way a user can see what posts other user favorites ?

  • Jane

    i just installed it and it worked fine :)

    I have one question. Is it possible when you show all your favorites that you get image of the article/item/blog you liked also? Orelse you have to remember it by the name.

    Then i would be sooo happy :D

    (i am newbie in wordpress, so i am not a geek on codes.. i hope its possible to install something so it just work?)

    • http://www.wpbeginner.com Editorial Staff

      Yes it is possible, but you would have to edit a few codes. wpfp-page-template.php << Look at this file in the plugin’s folder. You would basically have to recreate this query in your custom page template. Sorry, it sounds a bit overwhelming, but that is what is needed.

      • Jane

        Ok – thanks for the reply. I have been looking for a nice theme where its already done, but with no luck. I am not good enough myself, when it comes to make coding from scratz.. :)

    • Cory

      I was able to show the content of my post by adding the_content to the template.

  • Cory

    If you’re having issues with being able to favorite a post and it never shows in your favorites page, try this solution: http://wordpress.org/support/topic/custom-post-type-24?replies=10

    worked perfectly for me!

  • kenny

    This plugin is not functioning at all I installed it and activated it but my server respond with fatal error whoever is a developer of this plugin should get rid of it and stop putting low grades on WordPress awsome plugins.

  • Abigail Gorton

    I think this is one of thoie plugins we could politely call ‘delicate’. It has an awesome features list and when it works it is just great but it is obviously NOT working on every theme / relaease / server and it is not playing nicely with other plugins.

    I really want this functionality. When I first installed it, it was up and running immmediately. When I tried to configure it a bit, it broke. When I uninstalled it, I found that the uninstall was not clean and complete – it was no longer showing in my admin panel, or through standard FTP, but when I did ‘show hidden files’ on FTP it showed up. This is so wrong – shoulda uninstalled when it claimed to form admin and should not be hidden.

    So I deleted the hidden files but when I reinstalled the plugin, some of my settings were still as configured which suggest I was not able to fully remove it form my server. So wrong.

    I have tried deleting and reinstalling multiple times and cannot get it back to clean.

    So I am one of the 50% for whom it does not work, which is a shame as it looke pretty good for the 5 minutes it was up on my site.

  • Ubaidullah Butt

    When I used “{{wp-favorite-posts}}” for showing up all favorite posts on a page, There was nothing except “Clear Favorites” link. Can anybody help me with this. Thanks in advance.

    • http://www.wpbeginner.com Editorial Staff

      Did you favorite any post? If not, then do that first and the page will update itself.

      • Tito

        Hi, I’m currently have this problem and yup I’ve favorited numerous posts and still nothing. Any ideas? The support forum is all but dead unfortunately :(

        Cheers

        • Cory

          I have the same issue. Favorited a bunch of posts. they dont show in the favorites page. did you fix it?

  • Milan

    Thanks a lot. The post is very helpful.

  • Guillermo Santiago

    The WP Favorite Posts plugin Sucks. It is also deprecated and not functioning properly with wordpress 3.2 up. Do your homework.

    • http://www.wpbeginner.com Editorial Staff

      The article was written in March. We have the plugin running on sites using 3.4.2 and it is working. Perhaps you should do your homework.

  • Pranjal

    Though, it words good but that Gif loading image is continuously showing wherever, I had implemented. And also there’s no support from the developer of this plugin :(

  • Jared

    I also used this plugin for a client project a few months back and it worked just fine – despite the voting.

  • Kyle Suss

    Any idea if this works for custom post types?

    • http://www.wpbeginner.com/ wpbeginner

       @Kyle Suss Not sure if it does, but if it doesn’t, it wouldn’t be very hard to make that customization.

  • http://rachmadin.com/ frachmadin

    Hi, thanks for this great post. I am currently using GD Star Rating plugin on my blog. Do both have the same or different functions? I am interested to try using the WP Favorite Posts plugin. Thank you.