Facebook Plugin Breaks WordPress’ Pagination

Facebook WordPress Plugin Breaks Pagination

For one of the websites I created, XpatGirls.com, I installed Facebook’s official plugin for WordPress. It’s a nice plugin, that adds some “social” elements to your blog, instead of installing different plugins for different purposes, including:

  • Facebook’s Open Graph Protocol
  • Insights
  • Like, Send and follow buttons
  • Recommendation bar etc.

So, I installed the plugin on the website, like I do with almost every website that I build. A couple of weeks later, I found out that WordPress’ pagination was broken. Although the pagination appeared at the bottom of the blog, clicking on the page numbers / previous / next – would do nothing but navigate to the main page. So like everytime there’s a problem with WordPress, I started disabling themes and plugins, in order to isolate the problem, and then resolve it.

How to fix WordPress’ pagination problem caused by Facebook plugin

In the end, I found out that the Facebook plugin was the trouble maker.

To make a long story short, and to make your life easier, try adding the following piece of code to the end of the file functions.php (inside the theme’s folder). It solved my problem, and I hope it’ll solve yours.

function td_pagination_fix() {
 global $wp_query;
add_action( 'wp', 'td_pagination_fix', 111 );

I assume it only happens with specific themes, so if you encountered this issue, please mention your theme in the comments below.

Invite All Friends to Like a Facebook Page / Event – 2014

Facebook Invite All Friends

Recently I started a new website about The Best Flea Medicine For Dogs. The website is all about flea treatment and flea control for dogs.

When I created the Facebook Page for the website, I needed some initial likes in order for the page to become viral. I had 2 options:

1. Create ads on Facebook (recently I read and watched a video says that the audience that you get from advertising on Facebook is pretty much useless).

2. Invite all my friends to like the page.

We, or everyone who’s in the social media business, know that Facebook won’t let you to invite all your friends to like a page / invite to an event, since it’s a “spammy” action, which is pretty much true, but this is not the issue right now. So if Facebook won’t let you to invite them all together, there’s probably a hack, workaround to get it done. And there’s one.

Until recently, we used to copy some JavaScript code, paste it in the browser’s address bar, click “enter” and we got to invite all of our friends. The other method was to copy the code, paste it in Chrome’s console and run the code. This is not working anymore and if you try to do that, you’ll get this message: “SyntaxError: Unexpected token ILLEGAL error”. Facebook has blocked this method, but not totally.

How to invite all friends to like a Facebook Page / invite them to an event

So I found out there’s a solution to invite all of your friends to like a Facebook page, and you can all use it for your marketing efforts and needs, but I must warn you that you’re using this code at your own risk.

In order to get it to work properly, follow the following steps.

1. First – use Google Chrome. I haven’t tested it on other browsers, but I know it works for sure on Google Chrome.

2. Visit this page – a warning by Facebook about JavaScript console and why it is disabled by them. PLEASE READ IT CAREFULLY and approve it. Without accepting this page, it will not work. This is what the page looks like:

Facebook Self XSS message
Facebook Self XSS message

3. Copy the following code:

javascript:var inputs = document.getElementsByClassName('uiButton _1sm');

for(var i=0; i<inputs.length;i++) {



4. Go to your Facebook page and make sure you’re using Facebook as yourself, and not as your page.

5. In the top area, go to “Build Audience” and click on “Invite Friends”.

6. Make sure the dropdown is set to “All Friends”.

7. Now you get to see a list of some of your friends. Since we want to invite them all, scroll the list down to the end. TIP: use your mouse’s auto-scroll button (if it has it) instead of manual scrolling.

8. When you get to the bottom of the list, click CTRL + SHIFT + J, to open Chrome’s Developer Tools, and click on “Console” on the very right:

Google Chrome Console
Google Chrome Console

9. Paste the code you have copied in the Console.

10. Press “Enter” and let the magic happen!

If you have many friends, this process can take some time. You’ll notice that your friend names are being “checked” one by one, which means they’ve been invited.

You’re welcome, and if I helped you, please like my page below: