I have had looked around for a while without success. I would like to make the default tagline editor in the Wordpress admin area being rendered as <textarea></textarea> instead of <input type="text"> element. Is there any way to do it?

The tagline inputs I am talking about can be found in wp-admin > Settings > General and wp-admin > Appearance > Customize > Site Identity.

enter image description here enter image description here

  • The tagline is output within the <title> tag of the website. It does not support line breaks or HTML or anything you're thinking of adding. If you're trying to have something different in your header, then you'd be better of creating a child theme and modifying the header directly in that. – Jacob Peattie Jun 7 '19 at 8:38
  • I dont want to support line breaks, but the tagline is quite long which will be cumbersome for the admin to edit in the current <input> element. Recently they need to copy the text from the input into a text editor, edit it, then copy the edited text again into the input box. That's why it would be nice if I could replace it with <textarea>. @JacobPeattie – Biró Norbi Jun 7 '19 at 11:17

I could be wrong but I don't think there's an easy way to modify these fields generally, you'd probably need to use a bit of JavaScript in the admin to manipulate the field when the page loads to change it from an input to textarea.

I've not tested this, but something like this in jQuery might work if triggered on page load:

$( '#blogdescription' ).replaceWith( '<textarea id="#blogdescription" name="blogdescription" aria-describedby="tagline-description" class="regular-text">' + $( '#blogdescription' ).val() + '</textarea>' );
|improve this answer|||||
  • I did not downvote your answer, however this is not exactly the solution I am looking for – Biró Norbi Jun 7 '19 at 11:18
  • I can appreciate this is not exactly the solution you're looking for, but unfortunately the methods to manipulate text fields within certain sections of the admin e.g. settings page or User profile page just don't exist. Obviously hacking on the core WordPress files is not the correct way to do it, so a bit of manipulation with JavaScript can unfortunately be the only way to find a solution. The only other potential solution is not to use the actual tagline field but add a new custom field to the settings page which you set as a textarea and use that in the theme instead of the tagline field. – Rick Curran Jun 10 '19 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.