diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index f8c3a01..acbbb33 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -2584,9 +2584,9 @@ function comment_unpublish_action($comment, $context = array()) {
  * @see comment_unpublish_by_keyword_action_submit()
  */
 function comment_unpublish_by_keyword_action($comment, $context) {
+  $text = drupal_render($comment);
   foreach ($context['keywords'] as $keyword) {
-    $text = drupal_render($comment);
-    if (strpos($text, $keyword) !== FALSE) {
+    if (strpos($text, $keyword) !== FALSE || (!empty($comment->subject) && strpos($comment->subject, $keyword) !== FALSE)) {
       $comment->status = COMMENT_NOT_PUBLISHED;
       watchdog('action', 'Unpublished comment %subject.', array('%subject' => $comment->subject));
       break;
diff --git a/modules/node/node.module b/modules/node/node.module
index fb3756d..ee638aa 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -3787,9 +3787,10 @@ function node_unpublish_by_keyword_action_submit($form, $form_state) {
  * @ingroup actions
  */
 function node_unpublish_by_keyword_action($node, $context) {
+  $elements = node_view(clone $node);
+  $text = drupal_render($elements);
   foreach ($context['keywords'] as $keyword) {
-    $elements = node_view(clone $node);
-    if (strpos(drupal_render($elements), $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) {
+    if (strpos($text, $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) {
       $node->status = NODE_NOT_PUBLISHED;
       watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_type_get_name($node), '%title' => $node->title));
       break;
