As an expert in OnlyFans marketing and WordPress development, I’ve discovered a game-changing method to supercharge your landing pages and significantly boost conversions. By integrating real-time OnlyFans data into your WordPress site, you can create a dynamic and engaging experience that entices visitors to subscribe. In this article, I’ll share how I implemented this strategy and saw a remarkable increase in new fans within a short period.
The Power of Real-Time Data
One of the biggest challenges for OnlyFans creators is keeping their landing pages fresh and engaging. Static content can quickly become stale, but with real-time data, you can showcase:
- Current online status
- Latest photo and video counts
- Up-to-date subscriber counts and likes
- Active promotions and discounts
This dynamic information creates a sense of urgency and relevance that static pages simply can’t match.
Implementing the OnlyFans Data Scraper
Since OnlyFans doesn’t provide an official API, we’ll use a clever workaround with Apify.com and a custom scraper. Here’s how to set it up:
- Sign up for an Apify account and subscribe to the OnlyFans Profile Scraper (approximately $20/month).
- Configure the scraper with your OnlyFans profile URL.
- Set up a schedule to run the scraper every 30 minutes for fresh data.
WordPress Integration: The Magic Behind the Scenes
To bring this data into your WordPress site, we’ll use a custom PHP script that fetches the Apify data and stores it locally. Here’s an overview of the process:
- The script retrieves data from Apify’s API.
- It saves the data as a JSON file in your wp-content/uploads/ directory.
- A cron job updates this file every 30 minutes.
- Custom fields are created for specific pages.
- Shortcodes are generated for easy data insertion anywhere on your site.
Implementing the Code
To implement this functionality, you’ll need to use a plugin like “Code Snippets” to add the custom PHP code. The provided script handles all the heavy lifting, including:
- Fetching and storing OnlyFans data
- Creating custom fields for specific pages
- Generating shortcodes for easy data insertion
Remember to update the Apify URL and adjust any specific links or page IDs in the code to match your setup.
<?php
/**
* OnlyFans Data Fetcher and Display
*
* This script fetches OnlyFans profile data and provides shortcodes to display it.
*
* @author pattaya.love
* @link https://pattaya.love
*/
// Configuration
$APIFY_URL = 'https://api.apify.com/v2/actor-tasks/aspiring_tablet~onlyfan-profile-scraper-task/runs/last/dataset/items?token=apifytoken';
$POST_IDS = [XXX, XXX]; // Post IDs for custom fields
$OF_LINK = 'https://onlyfans.com/creator'; // OnlyFans affiliate link
$DEFAULT_SUBSCRIBE_PRICE = 14.69; // Default original price outside of promotions
// Function to format time difference
function time_ago($datetime) {
$time = strtotime($datetime);
$current_time = time();
$time_difference = $current_time - $time;
if ($time_difference < 1) {
return 'just now';
}
$condition = [
12 * 30 * 24 * 60 * 60 => 'year',
30 * 24 * 60 * 60 => 'month',
24 * 60 * 60 => 'day',
60 * 60 => 'hour',
60 => 'minute',
1 => 'second'
];
foreach ($condition as $secs => $str) {
$d = $time_difference / $secs;
if ($d >= 1) {
$r = round($d);
return $r . ' ' . $str . ($r > 1 ? 's' : '') . ' ago';
}
}
}
// Function to format time until a future date
function time_until($datetime) {
$time = strtotime($datetime);
$current_time = time();
$time_difference = $time - $current_time;
if ($time_difference < 0) {
return 'expired';
}
$days = floor($time_difference / (60 * 60 * 24));
$hours = floor(($time_difference % (60 * 60 * 24)) / (60 * 60));
if ($days > 0) {
return $days . ' day' . ($days > 1 ? 's' : '');
} elseif ($hours > 0) {
return $hours . ' hour' . ($hours > 1 ? 's' : '');
} else {
return 'less than an hour';
}
}
// Function to load OnlyFans data
function load_onlyfans_data() {
global $DEFAULT_SUBSCRIBE_PRICE;
$uploads_dir = wp_upload_dir();
$file_path = $uploads_dir['basedir'] . '/onlyfans_data.json';
if (file_exists($file_path)) {
$data = json_decode(file_get_contents($file_path), true);
if (is_array($data) && !empty($data)) {
$data = $data[0];
} else {
$data = [];
}
} else {
$data = [];
}
return [
'lastSeen' => $data['lastSeen'] ?? 'Available',
'photosCount' => $data['photosCount'] ?? '100+',
'videosCount' => $data['videosCount'] ?? '10+',
'favoritedCount' => $data['favoritedCount'] ?? '31000',
'subscribePrice' => $data['subscribePrice'] ?? $DEFAULT_SUBSCRIBE_PRICE,
'avatar' => $data['avatar'] ?? 'Not found',
'header' => $data['header'] ?? 'Not found',
'about' => $data['about'] ?? 'Not found',
'promotions' => $data['promotions'] ?? []
];
}
// Function to format numbers into a shorter notation
function format_number_short($number) {
if ($number >= 1000000) {
return round($number / 1000000, 1) . 'M';
} elseif ($number >= 1000) {
return round($number / 1000, 1) . 'K';
} else {
return $number;
}
}
// Function to handle shortcodes
function onlyfans_shortcode_handler($atts) {
global $OF_LINK;
$atts = shortcode_atts(['info' => ''], $atts);
$data = load_onlyfans_data();
$info = strtolower($atts['info']);
$output = '';
switch ($info) {
case 'lastseen':
if (!empty($data['lastSeen']) && $data['lastSeen'] !== 'Available') {
$last_seen_time = strtotime($data['lastSeen']);
if ($last_seen_time > 0) {
$current_time = time();
$time_difference = $current_time - $last_seen_time;
if ($time_difference <= 30 * 60) { // Available for 30 minutes
$output = '🟢 ' . '<a href="' . $OF_LINK . '" rel="nofollow" target="_blank" rel="I am online">Available</a>';
} else {
$output = 'Last seen ' . time_ago($data['lastSeen']);
}
} else {
$output = '🟢 ' . '<a href="' . $OF_LINK . '" rel="nofollow" target="_blank" rel="I am online">Available</a>';
}
} else {
$output = '🟢 ' . '<a href="' . $OF_LINK . '" rel="nofollow" target="_blank" rel="I am online">Available</a>';
}
break;
case 'photoscount':
$output = '<i class="far fa-image"></i> ' . esc_html($data['photosCount']);
break;
case 'videoscount':
$output = '<i class="fas fa-video"></i> ' . esc_html($data['videosCount']);
break;
case 'favoritedcount':
$formatted_count = format_number_short($data['favoritedCount']);
$output = '<i class="fas fa-heart"></i> ' . esc_html($formatted_count) . ' Likes';
break;
case 'subscribeprice':
if (!empty($data['promotions']) && isset($data['promotions'][0])) {
$promo = $data['promotions'][0];
$output = '$' . esc_html(number_format($promo['price'], 2));
}
break;
case 'subscribemessage':
if (!empty($data['promotions']) && isset($data['promotions'][0])) {
$promo = $data['promotions'][0];
$original_price = floatval($data['subscribePrice']);
$promo_price = floatval($promo['price']);
$discount_percentage = round((($original_price - $promo_price) / $original_price) * 100);
$output = '<strong>🎉 BIG OF PROMOTION - ' . $discount_percentage . '% DISCOUNT! 🎉</strong><br>🔥 <strong><a href="' . $OF_LINK . '" target="_blank" rel="nofollow" title="BIG PROMOTION DEAL">Special price: <i class="fas fa-dollar-sign"></i>' . esc_html(number_format($promo_price, 2)) . '!</a></strong> 🔥<br>💥<strong> Don't miss out! Offer ends in ' . time_until($promo['finishedAt']) . '!</strong>💥';
}
break;
case 'subscribefinishedat':
if (!empty($data['promotions']) && isset($data['promotions'][0])) {
$promo = $data['promotions'][0];
$output = time_until($promo['finishedAt']);
}
break;
case 'avatar':
$output = '<img src="' . esc_url($data['avatar']) . '" alt="Avatar" width="150">';
break;
case 'header':
$output = '<img src="' . esc_url($data['header']) . '" alt="Header" width="300">';
break;
case 'about':
$output = esc_html($data['about']);
break;
default:
$output = 'Information not available.';
}
return $output;
}
// Register shortcodes
add_shortcode('onlyfans', 'onlyfans_shortcode_handler');
// Function to fetch OnlyFans data from Apify
function fetch_onlyfans_data() {
global $APIFY_URL;
$response = wp_remote_get($APIFY_URL);
if (is_wp_error($response)) {
return;
}
$response_code = wp_remote_retrieve_response_code($response);
if ($response_code != 200) {
return;
}
$data = wp_remote_retrieve_body($response);
$data_array = json_decode($data, true);
// Define the path to the JSON file in the uploads directory
$uploads_dir = wp_upload_dir();
$file_path = $uploads_dir['basedir'] . '/onlyfans_data.json';
file_put_contents($file_path, json_encode($data_array, JSON_PRETTY_PRINT));
// Update custom fields with the new data
update_onlyfans_custom_fields($data_array);
}
// Function to update custom fields
function update_onlyfans_custom_fields($data_array) {
global $POST_IDS, $DEFAULT_SUBSCRIBE_PRICE;
if (is_array($data_array) && !empty($data_array)) {
$data = $data_array[0];
foreach ($POST_IDS as $post_id) {
// Update custom fields
update_post_meta($post_id, 'last_seen', $data['lastSeen'] ?? 'Available');
update_post_meta($post_id, 'photos_count', $data['photosCount'] ?? '100+');
update_post_meta($post_id, 'videos_count', $data['videosCount'] ?? '10+');
update_post_meta($post_id, 'favorited_count', $data['favoritedCount'] ?? '32000');
update_post_meta($post_id, 'subscribe_price', $data['subscribePrice'] ?? $DEFAULT_SUBSCRIBE_PRICE);
if (!empty($data['promotions']) && isset($data['promotions'][0])) {
$promo = $data['promotions'][0];
update_post_meta($post_id, 'promo_price', $promo['price']);
update_post_meta($post_id, 'promo_message', $promo['message']);
update_post_meta($post_id, 'promo_finished_at', $promo['finishedAt']);
} else {
// Clear previous promotions if no current promotions are found
update_post_meta($post_id, 'promo_price', '');
update_post_meta($post_id, 'promo_message', '');
update_post_meta($post_id, 'promo_finished_at', '');
}
update_post_meta($post_id, 'avatar', $data['avatar'] ?? 'Not found');
update_post_meta($post_id, 'header', $data['header'] ?? 'Not found');
update_post_meta($post_id, 'about', $data['about'] ?? 'Not found');
}
}
}
// For external cron job, you can call the function directly
function execute_onlyfans_fetch() {
fetch_onlyfans_data();
echo "OnlyFans data updated successfully.";
}
?>
This is the cron job that updates the .json file every 30 minutes: cd /var/www/xxx/htdocs && wp eval ‘execute_onlyfans_fetch();’
Showcasing Dynamic Data with Shortcodes
Once the system is in place, you can easily display OnlyFans data using shortcodes like: (Remove the space)
[ onlyfans info="subscribemessage"]
– Displays current promotions[ onlyfans info="lastseen"]
– Shows when you were last online[ onlyfans info="favoritedCount"]
– Displays your total likes[ onlyfans info="photosCount"]
– Shows the number of photos[ onlyfans info="videosCount"]
– Displays the video count
These shortcodes can be placed anywhere in your WordPress editor, allowing for flexible and dynamic content creation.
The Impact on Conversions
After implementing this system on my own landing pages, I saw a significant increase in new subscribers. The real-time data, especially the “last seen” status and current promotions, created a sense of urgency that drove more visitors to click through to my OnlyFans profile.
Ethical Considerations and Limitations
It’s important to note that this method doesn’t allow for downloading images or videos from OnlyFans. It simply displays metadata about your profile, which is publicly available information. This approach respects OnlyFans’ terms of service while still providing valuable, engaging content for your landing page.
Conclusion
By integrating dynamic OnlyFans data into your WordPress landing pages, you can create a more engaging, up-to-date, and conversion-focused experience for your visitors. This method has proven to be a powerful tool in my OnlyFans marketing arsenal, and I’m confident it can do the same for you.
Remember, the key to success is in the presentation of this data. Use it to tell a story, create urgency, and showcase the value of your OnlyFans content. With this strategy, you’ll be well on your way to growing your subscriber base and taking your OnlyFans career to new heights.