Site logo

Archived topic

Can't remove URL field in comments (for posts)

5 replies · Started by jack on September 25, 2022

Viewing posts 1–6 of 6

Hey GeneratePress support,

No matter what I do, I can't seem to remove this Website field on my site.

https://gyazo.com/e1f8436ee5f9334be39d2ef40065c4f6

I also want to remove the checkbox.

I've tried adding a css snippet.

.comment-form #url{
	display:none;
}

I then removed the css and added a php snippet
add_action( 'after_setup_theme', 'tu_add_comment_url_filter' );

function tu_add_comment_url_filter() {
    add_filter( 'comment_form_default_fields', 'tu_disable_comment_url', 20 );
}

function tu_disable_comment_url($fields) {
    unset($fields['url']);
    return $fields;
}

Still it's not removing the URL field. How do I remove both the URL field and the checkbox? I'd rather not add a plugin if I don't have to.

Hi there,

Just tested the PHP snippet, and it should work.

How did you add the PHP snippet?

And are you using a child theme? If so, can you switch to the parent theme to test?

I just added the PHP snippet again for you to see.

Added in functions.php
https://gyazo.com/2ea9265f4298252e23c9a2c4c1b9f96b

I believe I'm using the main GeneratePress theme
https://gyazo.com/55380ca56fe9e43535189d54a65c48d8

I've downloaded a template from the site library, but I don't think that's a child theme is it?

I just want this URL to be removed, I've tried a bunch of things.

Site is jackshelton.com and the post is https://jackshelton.com/web-development-and-design/

Interesting. It could be a DNS issue on my end. I did clear my client cache several times. Glad it's working, thanks for checking Leo.

No problem :)

This archived topic is closed to new replies.