If you have a theme that you love, but it has some pesky links that you want to get rid of, there is a very easy way to do this without messing with the theme functions, page templates or any of the more advanced WordPress code. You can do it using CSS!
To do this, in your WordPress dashboard go to Appearance -> Editor and that should open up your style.css file. Then in your browser, open up your website, right click on the link you want to disable and choose “Inspect Element” or something similar depending on your browser. (Note, if you are using Safari, you must first install the developer tools. Chrome and Firefox can handle that without any extra installs.)
When you inspect the element, there should be something in an <a>
tag. There should be either an id or a class associated with that. If not, there should be a parent element, like a <div>
tag with a class or id. Then in your css enter #id_name or .class_name {
or if there is a parent element #id_name_of_parent a or .class_name_of_parent a {
followed by:
pointer-events: none;
cursor: default;
}
Here’s where knowing a little bit about CSS inheritance comes in handy. We would choose the section with an id of text-9
so that the other links on the page or on the site aren’t affected. The parent element doesn’t need to be the immediate parent, for instance for the image above you would put something like this into your style.css page: #text-9 a {...
.
pointer-events: none;
will disable anything from happening when you click on the element and cursor: default;
will make the cursor stay as the arrow instead of changing to a little pointer hand like it normally does for links.
That’s it, now your unwanted link is disabled!
Jay Kumar says
Thanks for your suggestion . This really help me in removing unwanted links from my website.