Friday, May 18, 2012

How to automatically create meta description from content in wordpress

How to automatically create meta description from content in wordpress


WordPress by default don't add a "meta description" tag to into blog. Its not necessary, but some SEO experts insists that this tag is important for our website SEO purpose. So isn't it a great idea about generating a "meta description" using the post content? In below I have describe a useful code which can do this purpose easily.
For this please paste the following code into the functions.php file under theme folder

function create_meta_desc() {
global $post;
if (!is_single()) { return; }
$meta = strip_tags($post->post_content);
$meta = strip_shortcodes($post->post_content);
$meta = str_replace(array("\n", "\r", "\t"), ' ', $meta);
$meta = substr($meta, 0, 125);
echo "< meta name='description' content='$meta' />";
}
add_action('wp_head', 'create_meta_desc');
The code is ready now

Tuesday, May 8, 2012

How to disable plugin updates on WordPress


How to disable plugin updates on your WordPress blog

Wordpress By default automatically checks if the plugins updates are available so after checking if its find new update available it will ask you to install it. Plugin update is useful in most cases, but when you may not want them to updates plugins, like if you modified a plugin especially for perticular website. So I describe an easy way to disable plugin updates on any WordPress blog, Please check

So simple: Just paste the following code into functions.php and save it. Thats all

remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );

I just got my #domain @BigRock. Get upto 25% off with my personalized coupon link Get upto 25% off