Easily add NoFollow attribute to your WordPress site’s menu links. There are two different methods for doing this thing, if you are using latest version of WordPress then you can do this right from your dashboard without editing your functions file.
Adding Nofollow Attribute To WordPress Menus (dashboard method):
Step-1 Visit your Dashboard -> Appearance -> Menus
Step-2 On the top right corner (below howdy) click Screen Options button
Step-3 Under the section Show advanced menu properties, check the box Link Relationship (XFN)
Step-4 Now while editing menus links you will find one more field of Link Relationship (XFN), simply write ‘nofollow’ for the links you want to be nofollow.