[Troubleshooting] WordPress “Add Media” Button Not Working

Since WordPress 3.7, more and more WP sites are experiencing this problem: “Add Media” Button Not Working

After clicking “Insert into Post button”, nothing happens !

Many topics on WordPress.org, but one of them actually tell the real cause and solutions.

Continue reading

Posted in WordPress | 2 Comments

Remove WooCommerce Generator Tag in Version 2.1.0 +

Remove WooCommerce Generator Tag

WooCommerce Generator Tag

Before Woocommerce 2.1.0 , we put the following code in functions.php file under active theme folder to remove generator meta tag:

//Remove WooCommerce Generator Tag
function remove_woo_commerce_generator_tag()
{
    remove_action('wp_head',array($GLOBALS['woocommerce'], 'generator'));
}
add_action('get_header','remove_woo_commerce_generator_tag');

With the release of Woocommerce 2.1.0, things have changed.
Continue reading

Posted in WordPress | 6 Comments

Exclude Certain IP/Country/Region/City Traffic from Google Analytics Reports

Google Analytics Reports is a must for websmasters to gain a deep view of your visitors behaviour.  Many of us are being bothered by ourselves:  We are actually one of the biggest traffic source, making the Analytics Reports less accurate.

So how to exclude unwanted traffic from the reports?

We are going to use the filter function of GA.

filter function of GA
Continue reading

Posted in Online Marketing | 1 Comment

Removing /product/ from Woocommerce Product Permalinks / Slugs

99% of WooCommerce users would prefer to use beautiful permalinks/slugs for WooCommerce product pages. But also for category pages!

We need a nice pluginRemove slug from custom post type  and some tricks.

After installing this plugin, we go to its settings page:

Remove slug from custom post type settings

Click the Save Changes button, your Woocommerce product page permalinks are now :

http://www.domain.com/productname/

If you want .html instead of /   , simply type in html and save changes.

woocommerce slug html

Now your product page slug should be :

http://www.domain.com/productname.html

Cheers !

In many cases, this plugin works like a charm, but sometimes it won’t work, especially in latest version of WordPress, as you can see, this plugin is not updated for 2 years….

The most typical problem is :

for old products, the slugs were changed successfully, but we can’t create new products, we would encounter 404 error when opening new product pages !

The solution is simple and quite funny:

Just set the publish time to some time long ago, today is 10th Jan. 2014, I set the publish time to 2013. Save it, your product were now “published long ago”, and you will be able to open the page, no 404 error anymore.

woocommerce 404 error

Another typical problem is that:

This plugin applies to all custom post type by default, we can’t exclude it from some other custom post types, like Portfolio (many themes have this sort of custom post type). So solve this, open the .htaccess file on root folder on your site.

# BEGIN REMOVE SLUG CUSTOM POST TYPE RULES
RewriteRule ^product /(.+)/$ /$1 [R=301,L]
RewriteRule ^product_variation/(.+)/$ /$1 [R=301,L]
RewriteRule ^/(.+)/$ /$1 [R=301,L]
RewriteRule ^/(.+)/$ /$1 [R=301,L]
RewriteRule ^portfolio/(.+)/$ /$1 [R=301,L]
# END REMOVE SLUG CUSTOM POST TYPE RULES

As you can see, there are many rules for other custom post types, like product_variation and portfolio. I would like to disable url rewritten for them. So I removed them, this code block becomes:

# BEGIN REMOVE SLUG CUSTOM POST TYPE RULES
RewriteRule ^product /(.+)/$ /$1 [R=301,L]
# END REMOVE SLUG CUSTOM POST TYPE RULES

Note: Don’t remove the 1st and last 2 lines which begins with #

Posted in WordPress | 12 Comments

Disable Clipboard Manipulations in Firefox

There are times when we copy some words from a webpage and find something new when we paste it, usually with some copyright related messages. See below as an example:

Test page: http://download.cnet.com/Mobogenie/3000-18511_4-75952185.html

cnet clipboard manipulations
Continue reading

Posted in Firefox | 4 Comments