WordPress Tips


WordPress Contact Form 7 Redirect To Thank You Page

If you are using WordPress Contact Form 7, you might want to redirect visitors to a thank you page when they successfully fill in your form. Ideal if you track completed goals in Google Analytics.

Go To WordPress dashboard and go to Contact Form 7 plugin settings page (click contact in your dashboard).

Find ‘Additional Settings’ at bottom of your form page and insert the following code:

on_sent_ok: "location.replace('http://www.yourwebsiteaddress.co.uk/thankyou/');"

Save form

Now visitors will be successfully redirected to your custom thank you page when they fill in your WordPress Contact 7 form.

* Noindex/Follow your  “thank you” page to keep it out of Google SERPS using a Robots Meta tag.

How To Import Large WordPress XML File Above Default Limit Size

WP – How To Import Large WordPress XML File Above Default Limit Size? I wanted to export the posts, comments, categories and tags of one WordPress blog and move the contents using the export option in WordPress Tools in Wp Admin.

I found out you can do this in .htaccess – just add the following:

#set max upload file size
php_value upload_max_filesize 25M
#set max post size
php_value post_max_size 25M

Where I have added “25m” you can edit this to abover whatever size your xml file is.

Now you can export a large xml file and upload the file to another wordpress blog.

Add Text To Home Page Only on WordPress Blog

I wanted to add a little snippet of unique text, and have it display on my self hosted WP blog home page ONLY.

It was actually very easy.

I added this code to my theme index.php:

<?php if(is_home() && !is_paged()):?>write text here<?php endif;?>

Note – I did not want a static home page for my wordpress blog (I wanted to display all my posts, but on the home page, just have a small piece of text on my blog home and no other pages or posts).

Simple stuff.

WordPress – List Recent Posts From A Single Category on Posts Within Same Category

I wanted to display the recent post titles from a specific category, to visitors who landed on a post within that specific category (and i didn’t want to use a plugin).

List posts from a specific category ONLY on pages within specified category:

<?php if (in_category(‘32‘)) { ?>
<div class=”moduletable”>
<h3>Latest Snippets</h3>
<ol>
<?php
global $post;
$myposts = get_posts(‘numberposts=5&order=DESC&orderby=post_date&category=32‘);
foreach($myposts as $post) :
setup_postdata($post);
?>
<?php the_permalink(); ?>”>
<?php endforeach; ?>
</ol>
</div>
<?php }else { ?>
<?php } ?>

NOTE – I’ve bolded

  • 5 (number of posts to display) and
  • 32 – the category ID

Theses are the items I used in the example :)

 

How To Exclude A Category From RSS Feed in WordPress:

You just need to add this code to your WP theme functions.php file:

<?php
function myFeedExcluder($query) {
 if ($query->is_feed) {
   $query->set('cat','-5');
 }
return $query;
}
 
add_filter('pre_get_posts','myFeedExcluder');
?>

In the above example –

-5

is the category ID I might want to exclude. :) – Pretty simple as it turned out.

We’ve built a subscription base of over @25,000 rss email subscribers with an interest in seo who expect a certain type of post to a particular schedule as a newsletter – but I also wanted the control of publishing posts that wouldn’t necessarily fit in with the normal seo related tips, and wouldn’t deluge my current subscribers with content they might not really want.

SO I wanted to be able to exclude a particular category from my RSS feed so I could publish more wordpress, web development and seo news type posts (like this one). :)

I can always do the odd round up post to let my subscribers know about this other content.

It could actually give me much greater control – perhaps if I publish something that’s popular, I can then have the option to promote to subscribers. Either way it’s more spider food for engines.

What Is The Best WordPress SEO Plugin?

Wordpress SEO Plugin by Yoast

WordPress SEO is easy to use, and powerful.

Yoast has a great free wordpress seo plugin.

I’m running WordPress SEO on Hobo.





Learn how you can get more sales from your website

Subscribe for free and let us share with you:

  • how to submit your site to Google, Yahoo & Bing
  • how to optimise your site to get more traffic from Google
  • how to target the most valuable keywords for your business
  • how to make your site rank better in free Google listings
  • how to rank high & avoid Google penalties in 2015

Trust Hobo with your SEO plan

SEO Audit