Not every WooCommerce store needs or wants a category or tag archive. is_product_category detects if current page is a WooCommerce category archive or not. Similarly, is_product_tag detects if it a product tag archive or not. So with below small snippet we can redirect category and tag archives to shop page…. Read More »
Disable feeds in WordPress
We like to do things without plugin. Specially small tasks like disabling feeds from WordPress. Many sites, specially non-blog sites, would like to disable feeds. With the below code snippet we will disable feed and remove feed links from header, which were generated by default. If anyone tries to access… Read More »
WooCommerce login redirect to custom page
When you use WooCommerce login form (usually my-account page), by default users are redirected to my-account page after successful login. Might not be the best way to showcase your shop. Some user might want to redirect logged in users to a custom page, some might consider redirecting to shop page…. Read More »
Check if an user already used a coupon before in WooCommerce store
Let’s say you don’t want one user to use the same coupon code multiple times. There is a default option in WooCommerce coupon settings to achieve this. But today we will try and achieve this using code. Above code will be triggered when a coupon is being added. It will… Read More »
Automatically Complete all WooCommerce orders
Many people likes to mark WooCommerce orders completed automatically, as soon as they are placed. There is no default option in WooCommerce to do this directly from admin panel. But this is very easy and small customization – a few lines of codes. Code goes in the functions.php file of… Read More »
Remove WooCommerce product link from cart and thank you page
WooCommerce product links can be removed from shopping cart and thank you page. woocommerce_cart_item_permalink filter deals with the product permalink on shopping cart page. And woocommerce_order_item_permalink filter deals on thank you page. Returning false will simply remove product links from those pages. In the above code, __return_false is a default… Read More »
Fix Visual Composer shortcode display in Relevanssi search result
If you use Visual Composer to build/design your pages, posts or custom post types, and use Relevanssi – A Better Search to replace the default WordPress search with some extra feature, you will see search results are coming up with visual composer shortcodes visible. By default, Relevanssi skips most of… Read More »
Hide YouTube related videos from other channels using WordPress Embed
When you add YouTube videos on your WordPress website using default WordPress Embed or the YouTube block, from block editor (which eventually uses WP Embed), it shows a nice YouTube video. But at the end of the video, you will see some “related videos”, which are from different channels. This… Read More »
Include custom post types in WordPress default search result
WordPress default search only works for post and page. When you search with the default search form, it will only look for a result within posts and pages. If you have custom post types, that will be ignored. Also you may want to exclude post or page from search results…. Read More »
Modify default WordPress author base URL
By default WordPress author slug is – /author/[author_display_name]. How about if we need to change this to something else? Perhaps your site is not in English, and you want author slug in your language? This is very easily controllable with author_base property of WP_Rewrite class. Code goes in the functions.php… Read More »
