user image

Shilpa
Published in : 2022-02-26

Way to disable Block URLs for WordPress Posts

Wordpress

On my homepage of the WordPress website, a number of posts are listed already, but I don't want to let the user browse posts from the list.

How can I hide or disable or not let the user browse such blog posts?

Comments

Shilpa Date : 2022-02-26

Best answers

10

Best answers

10

I was looking for the solution and I found a workaround. (I am curious to share what I did!)

 

While inspecting the HTML elements, I saw linkclass which was added in all of the posts by default. You can add below code snippet for that.

.linkclass {point-events: none; // it will work as disabled: true HTML Attribure}

Using this, visitors can't browse or navigate to see more posts.

Rakshit Date : 2022-02-27

Best answers

34

Best answers

34

You can achieve it by the below code,

[aria-current="page"] { cursor: default; pointer-events: none; color: green; cursor: default;}
<a href="index.html" aria-current="page">Post 1 link</a>

You can check the live demo on fiddle.

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

A custom WordPress Login page and URL
Publish date: 2022-02-10 | Comments: 2

Tag: Wordpress

How to display tags on each posts for customized wordpress theme?
Publish date: 2022-02-26 | Comments: 1

Tag: Wordpress

Will Google Dorking save my secure WordPress website running on HTTPS?
Publish date: 2022-02-26 | Comments: 1

Tag: Wordpress

Wordpress update button returns 404 [SOLVED]
Publish date: 2021-06-26 | Comments: 2

Tag: Wordpress

A Site Kit WordPress plugin bug.
Publish date: 2022-02-10 | Comments: 2

Tag: Wordpress

Add custom fields in user profile and display in Dashboard
Publish date: 2021-07-27 | Comments: 6

Tag: Wordpress

How to run wordpress with different themes in main domain and subdomain?
Publish date: 2022-03-01 | Comments: 1

Tag: Wordpress