Title: Anonymous Author
Last modified: November 9, 2020

---

# Anonymous Author

 *  Resolved [littler79](https://wordpress.org/support/users/littler79/)
 * (@littler79)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/anonymous-author-3/)
 * I’m trying to give the user the option to remain anonymous when they post a review.(
   users need to be logged in when posting a review).
    I’ve tried using add_filter(‘
   site-reviews/create/review-values’ and checking if the name is blank, then put
   in ‘Anonymous’ instead, but it seems to default in the user’s name before I get
   the chance to check for blank. I’ve also tried adding a checkbox so they can 
   tick ‘I want to be anonymous’ but then if I use the filter as above, it doesn’t
   pick up my custom form field (even though it is shown on the page). Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/anonymous-author-3/#post-13641128)
 * Why not just change the name format of displayed reviews?
 * ![](https://i0.wp.com/i.imgur.com/LomUV0s.png?ssl=1)
 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/anonymous-author-3/#post-13641203)
 * If you really only want to do this if they specifically want to remain anonymous(
   i.e. by checking a checkbox), then assuming the checkbox field is a custom field
   with a field name of “anonymous”, you can do this:
 *     ```
       add_action('site-reviews/review/build/before', function ($review) {
           if ($review->custom->anonymous) {
               $review->set('author', 'Anonymous');
           }
       });
       ```
   
 *  Thread Starter [littler79](https://wordpress.org/support/users/littler79/)
 * (@littler79)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/anonymous-author-3/#post-13643349)
 * Thank you so much, this is the code I needed, I’ve got it working now.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Anonymous Author’ is closed to new replies.

 * ![](https://ps.w.org/site-reviews/assets/icon-256x256.gif?rev=3307009)
 * [Site Reviews](https://wordpress.org/plugins/site-reviews/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/site-reviews/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/site-reviews/)
 * [Active Topics](https://wordpress.org/support/plugin/site-reviews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/site-reviews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/site-reviews/reviews/)

## Tags

 * [anonymous](https://wordpress.org/support/topic-tag/anonymous/)
 * [author](https://wordpress.org/support/topic-tag/author/)

 * 3 replies
 * 2 participants
 * Last reply from: [littler79](https://wordpress.org/support/users/littler79/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/anonymous-author-3/#post-13643349)
 * Status: resolved