When displaying your latest posts on the homepage, you might want to exclude some categories from displaying on this page.
- Wordpress Category Hiding Code In Hindi
- Wordpress Hide Category From Post
- Wordpress Category Hiding Code In Excel
There are many reasons why you would want to do this. You might want to keep your homepage for only news posts and relegate the rest of the posts to other sections accessed through the menu.
In any case, what we will need to modify is the WordPress loop. All WordPress themes make use of the loop, and the best way to modify it is by using the pre_get_posts hook.
Removing categories from the homepage can sometimes turn out to be quite a frustrating act for beginners, so here’s the easy way to do it.
In your theme’s functions.php file, just insert the following code, replacing the category IDs with the ones you want to exclude:
2 4 6 8 | if($query->is_home){ } } add_filter('pre_get_posts','exclude_category_home'); |
If you’re not familiar with how to obtain the category IDs, I recorded a short clip showing you how you can easily get the IDs for the categories you want to exclude:
Remove Categories from Homepage using a Plugin
If you’re absolutely not comfortable with editing your theme’s files, there is also a plugin alternative you can use.
Ultimate Category Excluder
Ultimate Category Excluder is a WordPress plugin that allows you to quickly and easily exclude categories from your front page, archives, and feeds. Just select which categories you want to be excluded, and UCE does all the work for you!
From the two plugins, I prefer Ultimate Category Excluder, it’s a simpler plugin and works perfectly for most needs. Another advantage when using a plugin solution is that you can easily remove categories not only from the homepage but also from other sections of your site.
In case you’re looking for a powerful WordPress hosting and a knowledgeable support team that can help you easily with any hosting issue, check out SiteGround.
Related Articles
- Want to remove the useless /category/ from your WordPress categories permalinks? If yes, put this code in your functions.php and you're done!
- A number of plugins are sprouting up, and their sole purpose is to hide the fact that you use WordPress. What's the reason for doing that? The number one reason…Watch most of the sinhala dubbed cartoons and children television program online for free. View all your favorite cartoons and enjoy. Cartoons are full of fun and children like to watch them all the day long because most children do not like being bored. Also they can learn lot of things as they are not dull and fantastical, which means that they are not realistic. Harry Potter 1 Sinhala Dubbed Kids Movies DOWNLOAD (Mirror #1). 4c5316f046 Compare prices now and save up to 75% on quality Harry Potter Kids! Oct 05, 2015 This is the first part of the Harry Potter re-dubs by Coldmirror in Full HD and with german and english subtitles. If you have any suggestions to make the subtitles better, feel free to post them. Harry potter 1 sinhala dubbed online full.
- When WooCommerce displays the single product page, by default it shows the products categories. If you're not using categories to organize your products, it's usually a better idea to remove…
Baffled about How to remove page title in WordPress? Tired of trying out countless methods to remove WordPress page title with no success? No need to feel miserable! We all know that WordPress is a super powerful platform but it has it’s own limitations as well! Read on as we provide you with the easy coding method to hide page title in WordPress.
Countless searches and unsuccessful edits on how to remove page title in WordPress can literally consume your day leaving you worn out and exhausted. Coding can break or make your day. While you already had your breaking part, here at Templatetoaster WordPress website builder, i will help you assemble those broken pieces and make your day.
The code snippets we are going to give you for manually getting right at it are certainly going to put a smile curve on your face.
Why Remove WordPress Page Title by the way?
First things first, what urges anyone in this web world playing around with WordPress to Google for “remove page title WordPress”? There must be some sane reasons for this. Right?
WordPress was made for Bloggers at First
Most of us know that WordPress was initially made as a blogging platform so some of the WordPress features may not get along with the WordPress users or entrepreneurs having their business website powered by WordPress.
Bad Page Title is a Terrible Sight
Page title matters a lot! The one which is not in harmony with the content of the page can annoy the users of the website instantly. Sometimes, you don’t want to distract the visitors’ attention from the page content by putting that big old “Home” or any other title, for several reasons.
So, there emerges a need to completely remove or hide the WordPress page title.
The coding method stated below is definitely a lifesaver. Go ahead with it. Believe in trial and error (you will if you’re a coder) without a second thought of searching for a solution to this problem anymore!
WordPress – Remove Page Title Manually
Don’t Add the Title to the Page
The quick and short-cut method to remove title in WordPress in the case of a specific page/ post title is:
Endings. Perks. Fallout 4 change npc appearance.
Simply don’t put the title where it was meant to be added. In the case of a post, you can leave the Title box empty and publish it on the go. There you have a post without a title! But remember your posts will not have any title in the list of your posts for a specific post/ posts, you’ve not entered the title for.
While this looks tempting and easy-to-do in the first place, it can have its own set of implications later on! That’s quite a sad fact though!
You may have to bear the brunt of taking this shortcut. You may find it difficult to locate your own posts without any titles and other unexpected issues may occur. So, let’s see how coding can work wonders to solve this problem…
WordPress – Remove Page Title using Code
You’ll need to follow these steps to get this done quickly and easily by editing your theme functions.php file. We suggest this as this method is more reliable.
Move Ahead with Caution!
Before you make any tweaks to your theme files and you are not a pro at editing PHP files, it is recommended to be watchful. Make sure that you don’t create a muddle of errors leading to a WSOD (White Screen of Death). It would be a better idea to copy the PHP file you are going to edit and put it into the Child theme folder of your theme.
How Crucial is the H1 tag?
Wordpress Category Hiding Code In Hindi
Just a quick note that H1 tag is the most crucial tag among all the tags on a website page. H1 tag or Page/ Post title decides the ranking of the page. It also is very influential in a way that search engines get to know from the H1 tag that what the page content is all about!
Follow these Steps to easily Remove Page Title in WordPress
Method #1
- To start with, log into your WordPress dashboard and navigate to Appearances > Editor. By default, the Stylesheet will load first when you click on the Editor tab.
- On the right sidebar, you will notice a list of PHP files of your theme. Go to functions.php file of your theme and copy the following code snippet into it. The code snippet below adds an extra class hidetitle to the post_class().
- After pasting this snippet of code into the functions.php file, click on Update File. Remember, this code snippet will work for the single post title of the selected page. Your WordPress theme must have support for post class (which most of the coded themes do have) for this code to work.
- You’ll further need to add the following to the stylesheet of your WordPress theme. Just click on the style.css file to add the below code lines to it.
The above code actually gives a substantial solution on how to remove page title in WordPress in an easy way. It is a tried and tested code that works very well with child themes as well as standalone WordPress themes.
The screenshots below show the result of adding the above coding lines:
Make sure that the theme uses the similar class for the page title as well. Otherwise, you will need to replace .entry-title with the same class as used by your theme. You can find out easily that which CSS class is used by your theme.
Just right-click on the post title in the browser and select Inspect Element. The browser will split up into a window on the side or below. The source code will be highlighted and look for the CSS class used for the post title.
Method #2
We are going to show you another method to remove WordPress page title. Simply follow these steps to add code to the CSS/ stylesheet of your theme.
- Firstly, you will need to find the class name related to the title tag. For this, navigate to the desired post/page in the browser and right-click to inspect element. The browser window will split up into two to show you the source code with highlighted text.
- Now, you will have to look for the class associated with your title tag as shown below. Most probably, you will see it included in the H1 tags. You will find “entry-title” included in h1 tags. Now you have the class of the required post/ page title tag.
- In the next step, you’ll have to search for the unique Post ID which is in numeric data. Example- ttr_post post-1 in this case. Most likely, you can spot it in the few lines above the class name which we looked up for earlier.
- Now, it’s time to navigate to the CSS/ stylesheet of your theme by going to the Appearances > Editor > Stylesheet – style.css.
- Copy the following code snippet and paste it into the bottom of the stylesheet to remove post title from the selected single post. Don’t forget to edit by adding your unique Post ID in place of the given example.On the other hand, if you want to remove the post/ page title from all the single post pages, copy and paste the below code:
After applying this code, you will see the post title disappear from the selected page/ posts!
Method #3
Yet another method to remove the page title in WordPress is explained below. For applying this method, you’ll need to make tweaks to PHP file of your theme.
- Navigate to the Appearances > Editor in the WordPress dashboard. You’ll see a number of types of files of your theme.
- Click on the content-page.php and remove the following code lines from it:
There you have it! This method works to remove the page title from all pages. Quite easy!
Remove WordPress Page Title using Plugins
A few plugins were available to remove WordPress page title which takes less time than working with coding method. Moreover, plugins are an easy way to add functionalities without messing with code which is perfect for newbies. Some of the plugins are as below
Sadly, all the above plugins are not reliable or have the reputation of “not working” in the forums.
WooCommerce – Remove Page Title Manually
In the first place, what could be the reason that the need to remove Page Title arises in WooCommerce product pages?
Most of the WooCommerce users find that the “Shop” title doesn’t go well with the customised look of their website or it’s just a personal choice to keep or not to keep the big old “Shop” title on the WooCommerce store!
One legible reason to remove page title on the ecommerce website can be to keep the spotlight on the “Product Description”. In simple words, just to keep the things decluttered on the Product page.
If you are one of the WooCommerce users looking for a way to remove the page title from the selected product page, you can follow the same steps as above (as given for WordPress website) to remove “Shop” title from the selected product page of your WooCommerce store.
Final Thoughts
In a nutshell, if you prefer coding methods to get the desired result on your website, simply add code lines. Specifically, when they are tried and tested as above to remove page title on both WordPress and WooCommerce.
On the other hand, if you are not yet ready to make tweaks in your PHP theme files and stylesheets, go for TemplateToaster, a website maker which is made to make your theme designing process as easy as possible! No technical skills or adding a line of code is needed to remove the page title. Just tick the Hide Title tab and you are done with 1 click of the mouse! Simple. Right? We made it so.
I would like to remove the category & tag base from WordPress URL. I have come across other posts and solutions which used plugins. I would like to stay away from plugins and have a solution from within functions.php. This would prevent any future plugin updates or WordPress default files from being changed.
Any help would be appreciated. Thanks!
I have tried these solutions so far:
- This htaccess solution did not work: http://mikepayne.co/2011/remove-category-base-from-url/
- These methods also failed: http://www.askapache.com/wordpress/remove-category-wordpress-urls.html
5,73522 gold badges4040 silver badges4848 bronze badges
cosmoonotcosmoonot1,54533 gold badges2424 silver badges3434 bronze badges
15 Answers
I liked this solution:
If you want to remove
/category/
from the url, follow these two steps:- Go to Settings >> Permalinks and select Custom and enter:
/%category%/%postname%/
- Next set your Category Base to
.
Save it and you’ll see your URL changed to this format:http:/yourblog.com/quotes/
(Source: http://premium.wpmudev.org/blog/daily-tip-quick-trick-to-remove-category-from-wordpress-url/)
optimiertesoptimiertes2,15811 gold badge1212 silver badges1111 bronze badges
- Set Custom Structure: /%postname%/
- Set Category base: . (dot not /)Have seen too many other good sites or tools go away. This remains an important functionality to have. IF the author is monitoring this.This once very useful article is sorely in need of an update: several of the mentioned options are by now defunct. How to download megaupload links for mac. I’m hoping this is a temporary situation, but I’m not optimistic. I was using urlchecker.org almost daily, but it has been getting a “Bad Gateway” error for the last couple days.
- Save. 100% work correctly.
user4414801user4414801
Whilst you dismiss it as a solution, the plugin is by far the easiest and most consistent method and they don't change any WordPress default files.
It hasn't needed to be updated for a year, so it is not exactly creating any problems with updates.
There is no simple hand rolled solution that will do all of this that does not just replicate what the plugin does from within your own functions.php
- Better and logical permalinks like myblog.com/my-category/ and myblog.com/my-category/my-post/.
- Simple plugin - barely adds any overhead.
- Works out of the box - no setup needed. No need to modifyWordPress files.
- Doesn't require other plugins to work.
- Compatible with sitemap plugins.
- Works with multiple sub-categories.
- Works with WordPress Multisite.
- Redirects old category permalinks to the new ones (301 redirect, good for SEO).
Plus you get the benefit that if WordPress does change, then the plugin will be updated to work whilst you would then have to figure out how to fix your own code on your own.
Maxime5,73522 gold badges4040 silver badges4848 bronze badges
AnigelAnigel3,15111 gold badge1212 silver badges2323 bronze badges
If you use
Yoast SEO
plugin just go to:And select
remove
from Strip the category base (usually /category/) from the category URL
.Regarding the tag removal I did not found any solution yet.
paulalexandrupaulalexandru7,14222 gold badges4141 silver badges6868 bronze badges
instead put this in your functions.phpworks fine, no redirect problems.
RobbertRobbert
The non-category plugin did not work for me.
For Multisite WordPress the following works:
- Go to network admin sites;
- Open site under
;
- Go to settings;
- Under permalinks structure type
/%category%/%postname%/
.This will display your url aswww.domainname.com/categoryname/postname
; - Now go to your site dashboard (not network dashboard);
- Open settings;
- Open permalink. Do not save (the permalink will show uneditable field as
yourdoamainname/blog/
. Ignore it. If you save now the work you did in step 4 will be overwritten. This step of opening permalink page but not saving in needed to update the database.
GouthamGoutham
If you're still searching for the combination (tags, categories and pages on the url-base), you can do it like I did.
- Open the settings for permalinks and set a dot (
.
) for the category- and tag-base (https://premium.wpmudev.org/blog/removing-category-base-urls-wordpress/) - Install the plugin wp-no-tag-base
Tested using Wordpress 3.9.1
If you have pages, categories or tags having the same name, the system will take:
- tag
- page
- category
4,88011 gold badge2828 silver badges4343 bronze badges
The dot trick will likely ruin your rss feeds and/or pagination. These work, though:
DaFois2,00955 gold badges1717 silver badges2424 bronze badges
Lucian DavidescuLucian Davidescu
Select Custom Structure in permalinks and add /%category%/%postname%/ after your domain. Adding '/' to the category base doesn't work, you have to add a period/dot. I wrote a tutorial for this here: remove category from URL tutorial
Jonny JordanJonny Jordan
https://wordpress.org/plugins/remove-category-url/Use this plugin it does the job perfectly of hiding the category-baseIt does not require any setting just install and activate.
GirishGirish
other solution:
In wp-includes/rewrite.php file, you'll see the code:
T.ToduaT.ToduaIn wp-includes/rewrite.php file, you'll see the code:
$this->category_structure = $this->front . 'category/';
just copy whole function, put in your functions.php and hook it. just change the above line with:$this->category_structure = $this->front . '/';
33.3k1212 gold badges145145 silver badges143143 bronze badges
fdrvfdrv
WordPress 5.0.2:
To remove category slug from existing posts, do this :
Wordpress Hide Category From Post
- Navigate to Settings > Permalinks and change Custom Structure from
/%category%/%postname%/
to:/%postname%/
- Keep Category and Tag bases empty (which is the default also)
- Save
All posts can now be directly accessed via
Nadeem KhanNadeem Khandomain.com/%postname%/
and all categories can be accessed via domain.com/category/xyz/
. WordPress will automatically add all the 301 redirects for the old urls. So, if someone accesses domain.com/%category%/%postname%/
, they will automatically get redirected to domain.com/%postname%/
.2,72911 gold badge2121 silver badges3434 bronze badges
I don´t know how to do it using code, but for those who doesnt care to use plugin. This one is a great one that works for me:
JmainolJmainol
Adding '.' or '/' won't work if you want a consolidated blog view. Also, I have know idea what that solutions would do for the RSS or XML feeds. I feel better sticking with the WP convention. However, I did come up with a more elegant approach.
First, I name the base category url 'blog'
Then I created a category called 'all'. Finally, I but all my subcategories under 'all'. So I get a url structure like this.
I put a custom label on the menu item called 'Blog', but it goes to blog/all. It would be a good idea to 301 redirect /blog to /blog/all in the .htaccess file to avoid the 404 on /blog.
jwogradyjwogrady
protected by Community♦Jul 21 '16 at 18:58
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Would you like to answer one of these unanswered questions instead?
Not the answer you're looking for? Browse other questions tagged wordpresscategoriesbase or ask your own question.
The Shop page is one of the most important pages on the E-Commerce website. Since the consumers can’t physically view what all products you are selling, it is very important to present a shop page in a way to make it easier for them to stay on the website and make a purchase decision.
This post is specifically for those who have built up the stores using the WooCommerce plugin. In this post, we will see how to show all product categories on shop page using WooCommerce customizer and how to hide WooCommerce categories from being displayed on the shop page.
WooCommerce lets you decide how you want your products to be displayed on a Shop page. Using Product Catalog under Appearance-> Customize->WooCommerce you can show the WooCommerce Shop page in a unique manner. For example, you can display only category, the category with products or only products.
Wordpress Category Hiding Code In Excel
- Show products: All the product will be listed.
- Show categories: All the categories will be listed
- Show categories and products: Products and Categories both will be listed.
If we select ‘Show categories‘ option under ‘Shop page display‘ then all the product categories will be displayed on the Shop page as shown in the below screenshot.
As you can see in the above screenshot, four categories are being listed on the Shop page. The first one is ‘Uncategorised’ category, which contains all the products that don’t have any category assigned then it will be considered in the ‘Uncategorised’ category. Other categories are Men, Women, Kids & Baby.
Hide a WooCommerce Category from Shop Page
In some scenarios, you don’t want to display some categories on the Shop page. Like the ‘Uncategorised’ category appearing on the shop page and that is ruining the presentation of it. Either by giving the correct name to this category or by hiding it from being listed on the Shop page the presentation of the shop page can be improved.
So let’s see how to hide WooCommerce categories from being displayed on Shop using a small piece of code as shown below.
I have added this code snippet in my currently active theme’s functions.php file. The magic of this code snippet is, it has removed the ‘Uncategorised’ category being displayed from the shop page as shown in below screenshot.
Important: Even though the category is being hidden from Shop page, but it is still accessible via URL.
Increase WooCommerce Store Sales
'I purchased Woo Commerce Abandoned Cart Pro for two websites and after three days of it being active, the plugin paid for itself with recovered sales.
I had one issues with setting up the plugin in one of my websites because of the custom nature of the site, however tech support was very responsive and fixed all the incompatibilities themselves – was definitly the best tech support service I have ever received.
Couldn’t recommend this plugin more – if you are having a high number of abandoned carts then this is then this plugin is for you!' - Timmy Weston