Title: Remove recipient (Message to only admin?)
Last modified: August 21, 2016

---

# Remove recipient (Message to only admin?)

 *  Resolved [oh123](https://wordpress.org/support/users/oh123/)
 * (@oh123)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/remove-recipient-message-to-only-admin/)
 * Is it possible to remove the “to:” form? The one were you name the recipient?
 * I just want the logged in users to be able to send messages to one only adress.
 * I havnt found any plugins for this function, maybe theres just a little tweak
   to accomplish this with your plugin?
 * Thanks
 * [https://wordpress.org/plugins/front-end-pm/](https://wordpress.org/plugins/front-end-pm/)

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

 *  Plugin Author [Shamim Hasan](https://wordpress.org/support/users/shamim51/)
 * (@shamim51)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/remove-recipient-message-to-only-admin/#post-4952984)
 * open fep-class.php
 * find
    [code]
 *     ```
       if($this->adminOps['hide_autosuggest'] != 'on' || current_user_can('manage_options')) {
       		$newMsg .="<noscript>Username of recipient</noscript><br/>";
               $newMsg .="<input type='hidden' id='search-qq' name='message_to' autocomplete='off' value='".$this->convertToUser($to)."".$message_to."' />
       		<input type='text' id='search-q' onkeyup='javascript:autosuggest(\"".$this->actionURL."\")' name='message_top' placeholder='Name of recipient' autocomplete='off' value='".$this->convertToDisplay($to)."".$message_top."' /><br/>
               <div id='result'></div>";
       		} else {
       		$newMsg .="<br/><input type='text' name='message_to' placeholder='Username of recipient' autocomplete='off' value='".$this->convertToUser($to)."".$message_to."' /><br/>";}
       ```
   
 * Replace with
 *     ```
       $newMsg .=" ADMIN<br />";
       ```
   
 * again find
 *     ```
       $preTo = $_POST['message_top']
       ```
   
 * Replace with
 *     ```
       $preTo = ADMIN_LOGIN
       ```
   
 * replace ADMIN_LOGIN with your username where you want to receive message
 *  Thread Starter [oh123](https://wordpress.org/support/users/oh123/)
 * (@oh123)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/remove-recipient-message-to-only-admin/#post-4953061)
 * Thank you! It worked!
 * One problem thought (my fault because I wasnt clear enough)
 * Now persons can only send new messages to my admin, but my admin also needs to
   e able to send new messages (now he can only send to himself or answear a message.
   Would it be possible to fix this?
 * Maybe with using member rank? So that site admin can choose to send to anyone,
   but lower ranked, like authors, can only send to admin (dont want them to be 
   able to talk to each other).
 * Maybe this is to much to ask for?
 *  Plugin Author [Shamim Hasan](https://wordpress.org/support/users/shamim51/)
 * (@shamim51)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/remove-recipient-message-to-only-admin/#post-4953063)
 * cancel previous changes
 * delete
    [code]
 *     ```
       $this->adminOps['hide_autosuggest'] != 'on' ||
       ```
   
 * replace
 *     ```
       $newMsg .="<br/><input type='text' name='message_to' placeholder='Username of recipient' autocomplete='off' value='".$this->convertToUser($to)."".$message_to."' /><br/>";
       ```
   
 * with
 *     ```
       $newMsg .=" ADMIN<input type='hidden' name='message_top' value='ADMIN_LOGIN'<br />";
       ```
   
 * replace ADMIN_LOGIN with admin username. let me know this works for you. if you
   find any dificulty dont hesited to contact with me.
 * next release of this plugin i will add a secured contact form to use in website.
   then you can use that contact form to send message to admin from users/visitors.
 *  Thread Starter [oh123](https://wordpress.org/support/users/oh123/)
 * (@oh123)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/remove-recipient-message-to-only-admin/#post-4953065)
 * It seems to work perfect. Definitly rating this 5 stars. Im looking forward to
   that update to!
 * Just one more thing that i think may be an easy fix.. Is it possible to remove
   the link to others profile? Under the “started by” and “To” column in the message
   box? And under the “sender” in the message thread? So it shows the profile name
   but without the link to the profile?
 * Thank you very much for your support. It has been really fast and accurate!
 *  Plugin Author [Shamim Hasan](https://wordpress.org/support/users/shamim51/)
 * (@shamim51)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/remove-recipient-message-to-only-admin/#post-4953078)
 * Find and delete
    [code]
 *     ```
       if ($uSend->ID != $user_ID){
                 $msgsOut .= "<td><a href='".get_author_posts_url( $uSend->ID )."'>" .$uSend->display_name. "</a><br/><small>".$this->formatDate($msg->date)."</small></td>"; }
       		  else {
       ```
   
 * and
 *     ```
       if ($toUser->ID != $user_ID){
                 $msgsOut .= "<td><a href='".get_author_posts_url( $toUser->ID )."'>" .$toUser->display_name. "</a></td>";}
       		  else {
       ```
   
 * DO NOT forget to delete two
 *     ```
       }
       ```
   
 * immediately bellow line after this deleted two line.
 * For the message thread Find
 *     ```
       <a href='".get_author_posts_url( $uData->ID )."'>".$uData->display_name."</a>
       ```
   
 * Replace with
 *     ```
       ".$uData->display_name."
       ```
   
 *  Thread Starter [oh123](https://wordpress.org/support/users/oh123/)
 * (@oh123)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/remove-recipient-message-to-only-admin/#post-4953085)
 * Perfect. Thank you!
 *  [C. Pearie](https://wordpress.org/support/users/pearwcz/)
 * (@pearwcz)
 * [12 years ago](https://wordpress.org/support/topic/remove-recipient-message-to-only-admin/#post-4953260)
 * Thank you I can remove link of user from the message box now.

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

The topic ‘Remove recipient (Message to only admin?)’ is closed to new replies.

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

 * 7 replies
 * 3 participants
 * Last reply from: [C. Pearie](https://wordpress.org/support/users/pearwcz/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/remove-recipient-message-to-only-admin/#post-4953260)
 * Status: resolved