How to migrate from Credit Tracker to Image Source Control

How to migrate from Credit Tracker to Image Source Control to manage image author attributions. A technical guide.

The Credit Tracker plugin provided a way to manage image credits in WordPress, but it was closed in 2024 for security reasons and has been unmaintained for over five years. My Image Source Control (ISC) plugin offers a robust and actively developed alternative for managing and displaying image sources, credits, and captions. Plus, it helps you delete unused images.

Screenshot of the Credit Tracker plugin on wordpress.org with the information that it was closed for security reasons.
Credit Tracker was unmaintained for five years and closed in 2024 for security reasons.

A user recently asked me how to migrate from Credit Tracker to Image Source Control, and that conversation was so fruitful that I decided to convert it into this tutorial.

This guide will help you:

  1. Understand where Credit Tracker and Image Source Control store data.
  2. Migrate your core author and source link data using SQL.
  3. Optionally, clean up potential leftover data from Credit Tracker.
  4. Configure ISC to display credits similarly to Credit Tracker (if desired).
  5. Set up a Global Image Source List comparable to Credit Tracker’s.

Prerequisites

  • Image Source Control installed and activated.
  • Access to your WordPress database (e.g., via phpMyAdmin) is required for the SQL migration steps.
  • Ability to add custom PHP/CSS code (e.g., via a child theme’s functions.php, a code snippets plugin, or the theme customizer) for display adjustments.
  • A complete backup of your WordPress site.

If you are not comfortable writing code and executing SQL queries, you might want to consider migrating relevant image sources manually. You could delete unused images beforehand to save some time.

Step 1: Understanding the Data Fields

  • Credit Tracker: Stored data primarily as post meta associated with image attachments:
    • credit-tracker-author: The author’s name.
    • credit-tracker-link: The URL to the image source.
  • Image Source Control (ISC): Stores its source data similarly:
    • isc_image_source: The text displayed as the source/credit.
    • isc_image_source_url: The URL linked from the source text.
    • isc_image_source_own: A flag (value 1) indicating the image uses the “Standard Source” (often used for owned images or bulk sources).
    • isc_image_licence: Stores the selected license name (if used).

Step 2: Migrating Credit Tracker Data via SQL

Based on the user’s solution, this method transfers Credit Tracker data into ISC fields. It constructs the isc_image_source field by combining the Credit Tracker author and the domain name from the Credit Tracker link (e.g., “Author Name – stock.adobe.com”). It also adds the original Credit Tracker link to the image’s description field for reference.

Important: Run these SQL queries via a tool like phpMyAdmin. Remember your backup!

Replace wp_ with your actual database prefix if it’s different.

Query 1: Create ISC Source Text from Credit Tracker Data

This query inserts the combined author and platform into the isc_image_source meta key only for images that don’t already have an isc_image_source entry.

INSERT INTO wp_postmeta (post_id, meta_key, meta_value)
SELECT
    p.ID,
    'isc_image_source',
    CONCAT(ct_author.meta_value, ' – ', SUBSTRING_INDEX(SUBSTRING_INDEX(ct_link.meta_value, '/', 3), '/', -1))
FROM
    wp_posts p
JOIN
    wp_postmeta ct_author ON ct_author.post_id = p.ID AND ct_author.meta_key = 'credit-tracker-author'
JOIN
    wp_postmeta ct_link ON ct_link.post_id = p.ID AND ct_link.meta_key = 'credit-tracker-link'
LEFT JOIN
    wp_postmeta isc ON isc.post_id = p.ID AND isc.meta_key = 'isc_image_source'
WHERE
    p.post_type = 'attachment' AND isc.post_id IS NULL;Code language: SQL (Structured Query Language) (sql)

Query 2: Add Credit Tracker Link to Image Description for Reference

This appends the source link from Credit Tracker to the image’s description field (post_content for attachments) if it’s not already there. This keeps the link available for reference without displaying it via ISC by default.

UPDATE wp_posts p
JOIN wp_postmeta ct_link ON ct_link.post_id = p.ID AND ct_link.meta_key = 'credit-tracker-link'
SET p.post_content = CONCAT(COALESCE(p.post_content, ''), ' Source-Link: ', ct_link.meta_value)
WHERE p.post_type = 'attachment'
  AND COALESCE(p.post_content, '') NOT LIKE '%Source-Link:%';Code language: SQL (Structured Query Language) (sql)

Query 3 (Optional Check): Verify ISC Data

Use this to review the isc_ meta values for your attachments after running the migration queries.

SELECT p.ID, p.post_title, m.meta_key, m.meta_value
FROM wp_posts p
JOIN wp_postmeta m ON p.ID = m.post_id
WHERE p.post_type = 'attachment'
  AND m.meta_key LIKE 'isc_%'
  AND NOT m.meta_key LIKE 'isc_image_posts' -- Exclude index data
ORDER BY p.ID, m.meta_key;Code language: SQL (Structured Query Language) (sql)

Step 3: Optional Cleanup Credit Tracker – Addressing Leftover Captions/Shortcodes

Credit Tracker might have inserted captions directly into your post content (using the shortcodes) or filled the standard WordPress “Caption” field (post_excerpt for attachments). If you only used these for Credit Tracker sources and don’t use standard WP captions otherwise, you might want to clean them up.

EXTREME CAUTION: The following SQL queries modify post content and image captions directly.

Only use these if you are sure you don’t need existing caption data. Incorrect use can lead to data loss. Backup is critical. You can also use a plugin like WP Staging to test this on a staging site first.

Query 4 (Risky): Replace Content within [caption] Shortcodes in Posts

This attempts to replace the text between an image tag and the closing tag with a non-breaking space ( ), preserving the caption structure but removing the Credit Tracker text. This query works with MySQL 8 or higher.

UPDATE wp_posts
SET post_content = REGEXP_REPLACE(
  post_content,
  '(\\[caption[^\\]]*\\].*?<img[^>]+>)[\\s\\S]*?(\\[/caption\\])',
  '\\1&nbsp;\\2'
)
WHERE post_content REGEXP '(\\[caption[^\\]]*\\].*?<img[^>]+>)[\\s\\S]*?(\\[/caption\\])';Code language: SQL (Structured Query Language) (sql)

Query 5 (Risky): Clear Standard WordPress Image Captions

This deletes the content of the “Caption” field (post_excerpt) for all image attachments.

UPDATE wp_posts
SET post_excerpt = ''
WHERE post_type = 'attachment'
  AND post_mime_type LIKE 'image/%';Code language: SQL (Structured Query Language) (sql)

Recommendation: Instead of running Queries 4 and 5 blindly, manually review a few posts and images first to see if Credit Tracker left data behind, and decide if cleanup is necessary. Manual editing might be safer for smaller sites.

Step 4: Configuring ISC Display (Mimicking Credit Tracker Style)

Captions in Image Source Control are already styled. You can choose among different styles under Settings > Image Sources > Overlay, and you don’t need to make any adjustments from in this section.

If you prefer Credit Tracker’s simple text display below the image, you can achieve a similar look with ISC using a combination of settings and custom code.

  1. ISC Settings: Go to Settings > Image Sources > Overlay.
    • Set the “Style” option to Unstyled credit line below the image.
  2. Add PHP Filter: Use a code snippets plugin or your child theme’s functions.php to add the following filter. This wraps the ISC output in a <span> with standard WordPress caption classes and a custom class for easier styling.
<?php
/**
 * Filter ISC overlay output to add WP caption classes and a custom class.
 */
add_filter('isc_overlay_html_source', function($source = '', $image_id = 0) {
    // Add 'caption', 'wp-caption-text' for WP styling, and 'isc-source-text-custom' for specific overrides.
    return "<span class='caption wp-caption-text isc-source-text-custom'>$source</span>";
}, 10, 2);Code language: HTML, XML (xml)
  1. Add Custom CSS: Add the following CSS (via Customizer > Additional CSS or your stylesheet or theme options) to adjust the appearance slightly (e.g., opacity).
/* Custom styling for ISC source text when mimicking Credit Tracker */
.isc-source-text-custom {
  opacity: 0.9 !important; /* Example: Adjust opacity */
  /* Add any other styles needed to match your theme/preference */
}Code language: CSS (css)

This setup leverages your theme’s default caption styling while allowing minor tweaks. If you prefer other display options (like overlays), ISC offers many other settings you can configure.

Step 5: Verify Everything

After performing the migration and configuration:

  • Check several posts containing images previously credited with Credit Tracker. Ensure the ISC credits appear correctly in your chosen style.
  • Verify that images without Credit Tracker data are not showing ISC credits (unless intended via standard source options).
  • Check your Global List page to ensure it displays the correct images and information.
  • Test adding a new image and assigning ISC data to confirm standard functionality.

Conclusion

Migrating from Credit Tracker to Image Source Control involves transferring database information and adjusting display settings. You can successfully move your image attribution data on large sites by carefully following these steps and utilizing the provided SQL and code snippets (with appropriate caution). Smaller sites should instead do this manually.

Remember that backups are your safety net throughout this process.
For further customization or troubleshooting with ISC, please refer to the official Image Source Control Documentation or reach out via the support form.

Portrait of Thomas Maier, founder and CEO of Image Source Control

Questions? Feedback? How can I help?

Reach out directly via the contact form.