Title: subscribe widget?
Last modified: August 18, 2016

---

# subscribe widget?

 *  [specmav](https://wordpress.org/support/users/specmav/)
 * (@specmav)
 * [19 years, 10 months ago](https://wordpress.org/support/topic/subscribe-widget/)
 * Hey everyone! I wanted to know if there is a sidebar widget that will allow readers
   to subscribe to my blog via email. I tried subscribe2 and it wont show up in 
   the sidebar with the <!–subscribe2–> tag when used in a text box widget.
 * Thanks

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

 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/subscribe-widget/#post-402375)
 * TheSubscribe2 plugin is designed to only work from with a page. The code pasted
   below will work however the user will get no direct feedback upon submitting 
   their email address. Anyone can feel free to tinker to get this aspect working.
 * Copy the code below into a suitably named file (s2widget.php) and upload this
   to your widgets directory then use in the normal widget way.
 * Matt
 * <?php
    /* Plugin Name: Subscribe2 widget Description: Adds a sidebar widget for
   Subscribe2 Author: Matthew Robinson. Version: 1.0 Author URI: [http://www.prescriber.org.uk](http://www.prescriber.org.uk)*/
 * function widget_subscribe2widget_init() {
 * if ( !function_exists(‘register_sidebar_widget’) )
    return;
 * function widget_subscribe2widget($args) {
    extract($args); $options = get_option(‘
   widget_subscribe2widget’); $title = empty($options[‘title’]) ? __(‘Subscribe2’):
   $options[‘title’]; ?> <?php echo $before_widget; ?> <?php echo $before_title .
   $title . $after_title; ?>
    -  <form method=”post” action=””>
       Your email: <input type=”text” name=”email”
      value=”” size=”20″ />  <input type=”radio” name=”s2_action” value=”subscribe”
      checked=”checked” />Subscribe <input type=”radio” name=”s2_action” value=”
      unsubscribe” />Unsubscribe  <input type=”submit” value=”Send”/> </form>
 *  <?php echo $after_widget; ?>
    <?php } function widget_subscribe2widget_control(){
   $options = $newoptions = get_option(‘widget_subscribe2widget’); if ( $_POST[“
   s2w-submit”] ) { $newoptions[‘title’] = strip_tags(stripslashes($_POST[“s2w-title”]));}
   if ( $options != $newoptions ) { $options = $newoptions; update_option(‘widget_subscribe2widget’,
   $options); } $title = htmlspecialchars($options[‘title’], ENT_QUOTES); ?> <label
   for=”s2w-title”><?php _e(‘Title:’); ?> <input style=”width: 250px;” id=”s2w-title”
   name=”s2w-title” type=”text” value=”<?php echo $title; ?>” /></label> <input 
   type=”hidden” id=”s2w-submit” name=”s2w-submit” value=”1″ /> <?php }
 *  // This registers our widget so it appears with the other available
    // widgets
   and can be dragged and dropped into any active sidebars. register_sidebar_widget(‘
   Subscribe2Widget’, ‘widget_subscribe2widget’);
 *  // This registers our optional widget control form.
    register_widget_control(‘
   Subscribe2Widget’, ‘widget_subscribe2widget_control’); }
 * // Run our code later in case this loads prior to any required plugins.
    add_action(‘
   plugins_loaded’, ‘widget_subscribe2widget_init’); ?>
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/subscribe-widget/#post-402394)
 * I’ve made a few changes to the above code, new widget is here:
 * [http://www.prescriber.org.uk/sub2widget.php](http://www.prescriber.org.uk/sub2widget.php)
 * Along with my version of a widgetized theme and my amended version of the Subscribe2
   plugin. (Only minor changes)
 *  [echozone](https://wordpress.org/support/users/echozone/)
 * (@echozone)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/subscribe-widget/#post-402414)
 * Hi MattyRob,
    Thanks for your work on this widget! I’m just about to upgrade 
   + would like to hear if this is working, since I notice you are not currently
   using it on your site.
 * I see you are actually using the <!–subscribe2–> tag in the sidebar, which works
   but the user feedback is too subtle to easily notice!
 * This makes me think there is a problem with his widget working as is. Before 
   I go through the widgetizing coding just for this, I would really appreciate 
   hearing any issues you have discovered, or if it works.
 * I’m hoping to provide both sub + unsub in the sidebar form, as I have in the 
   older version when it had the separate subscribe.php file to point to. Now upgrading
   WP, I hope we can still have the previous UI elegance.
 * Thanks for your time!
 *  [echozone](https://wordpress.org/support/users/echozone/)
 * (@echozone)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/subscribe-widget/#post-402415)
 * I wanted to report that with WP 2.0.3, Subscribe2 v.222 works great from the 
   sidebar, without a widget, but with a customized form.
 * Upgrading from 1.5.2 to 2.0.3, I got the wrong impression from all I read, that
   people were unable to make the form work from the sidebar, besides just linking
   to the subscribe page, + that this required widgetizing.
 * That not making sense to me, I first tested without. Even the unsubscribe works
   from the sidebar. Here’s how I did it:
 * The form’s action directs to the page, + the radio buttons’ name + actions are
   the same as in the form generated by the plugin. It does pass the parameters 
   to the page, where the responses are output.
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/subscribe-widget/#post-402419)
 * echozone,
 * The widget works fine for me – it should be on my site, without problems, in 
   the sidebar.
 * I agree that the feedback is subtle – but is does appear where the Subscribe2
   form was in the sidebar. I’m sure there are other ways around this but it works
   for me as it is.
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/subscribe-widget/#post-402420)
 * MattyRob, the widget is properly activated in my widgetized theme at [http://vkaryl.net/ExMachina/](http://vkaryl.net/ExMachina/)(
   test platform), but I can’t get it to display the form, radios, etc. The basic
   setup shows when one views source, but for instance, viewing source on your plugins
   page shows the form for input, which is not showing on my page.
 * The other widgets I’m using for this client are working fine. Any thoughts?
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/subscribe-widget/#post-402421)
 * vkaryl,
 * It’s wrking on your site as expected. If you are logged in to your blog the form
   will be replaced with a message about managing your profile.
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/subscribe-widget/#post-402422)
 * Hi MattyRob…. I’d forgotten by now I asked. Yes, I did finally stumble on that
   conclusion. I’m a bit dim sometimes!
 * Thanks.

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

The topic ‘subscribe widget?’ is closed to new replies.

## Tags

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

 * 8 replies
 * 4 participants
 * Last reply from: [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * Last activity: [19 years, 7 months ago](https://wordpress.org/support/topic/subscribe-widget/#post-402422)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
