0

I tried this below but it does not work. I added it to my functions.php in my mu-plugins directory.

<?php
// to remove website textbox from Comments form
add_filter('comment_form_default_fields', 'url_filtered');
function url_filtered($fields) {
  if(isset($fields['url']))
  unset($fields['url']);
  return $fields;
}
?>
2
  • Works with Twenty Thirteen. I suspect there is a problem with your theme.
    – s_ha_dum
    Oct 11, 2013 at 20:47
  • Themes can do many things-- some right, some wrong. What theme is it?
    – s_ha_dum
    Oct 11, 2013 at 21:41

1 Answer 1

0

You made a mistake when put your functions.php file into mu-plugins directory. Why? Because your file rendered above is not a plugin, it is just a script. WordPress looks for a plugin inside mu-plugins directory. So you have to do one of two things:

  • Add plugin header into functions.php file
  • Move functions.php file into your theme root folder (+ merge it with existing one)

Plugin header:

<?php
/**
 * Plugin Name: Name Of The Plugin
 * Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
 * Description: A brief description of the Plugin.
 * Version: The Plugin's Version Number, e.g.: 1.0
 * Author: Name Of The Plugin Author
 * Author URI: http://URI_Of_The_Plugin_Author
 * License: A "Slug" license name e.g. GPL2
 */

// to remove website textbox from Comments form
add_filter('comment_form_default_fields', 'url_filtered');
function url_filtered($fields) {
  if(isset($fields['url']))
  unset($fields['url']);
  return $fields;
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.