Skip Navigation

[Resolved] Adding no follow to links in buttons in content template

This support ticket is created 4 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by GeoffS1889 4 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#1635711

I'm trying to add no follow attribute to all outbound links in buttons on my website.

All of the links are stored in custom fields on the post type.

Example of the 2 pages where I have links are:
hidden link
hidden link

I reviewed the other threads on adding nofollow to links, but they were not using the button or associated to a custom field on a different post type. How can I add this simple value to my links?

#1636993

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Geoff

You can't, I'm afraid, not when you use the Button block.

You can if you use the Fields and Text block and define your own markup for the button, to include the nofollow option.

In this example I took the same markup generated on the front-end by the Block button, and for the href attribute I used the Fields and Views button to insert the shortcode used to generate the URL from a "link" custom field, and then I added a rel="nofollow" attribute to the link. I could similarly add other attributes as required.

<div class="tb-button"><a class="tb-button__link" href="[types field='link' output='raw'][/types]" rel="nofollow"><i class="tb-button__icon"></i><span class="tb-button__content">My link</span></a></div>

It's easier when adding markup such as this with the Fields and Text block to use the HTML mode rather than the Visual mode.

I'll put in a request about adding options for this to the Button block.

#1640405

Thanks Nigel. This works for me. It would be great to see the no follow option built into the button / custom field options.