eBay Default Filters Tampermonkey Script

WARNING: DO NOT USE eBay WILL LOCK YOUR ACCOUNT.

USE “Advanced Search” INSTEAD!

If you are a regular eBay user – this is soooo frustrating – when eBay will not save filter settings – yes there is an “app” I am talking about real proper software! This will save your filters – no more endless entries from inaccessible countries that won’t deliver!

Download and install Tampermonkey for your browser.

This Tampermonkey script automatically applies default filters to eBay search pages, including item condition (new), free shipping, items located in your country, and sorting by lowest price plus shipping (P&P). Below is the explanation and the complete script.

Explanation

  • Purpose: The script modifies the eBay search URL to include specific filters when a search page loads.
  • Filters Applied:
    • LH_ItemCondition=1000: Filters for new items.
    • LH_ShippedFree=1: Filters for items with free shipping.
    • LH_LocatedIn=1: Filters for items located in your country.
    • _sop=15: Sorts results by lowest price plus shipping (P&P).
  • Logic:
    • The script checks if each filter is already present in the URL to avoid duplication.
    • If any filter is missing, it appends the filter to the URL and navigates to the updated URL.
    • Navigation only occurs if changes are made to prevent infinite reloads.
  • Event Trigger: The script runs when the page fully loads, using the load event listener.
  • Error Handling: Errors during execution are logged to the console for debugging.

Code

// ==UserScript==
// @name         eBay Default Filters
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Automatically apply default filters on eBay, including sort by lowest price + P&P
// @author       You
// @match        https://www.ebay.com/sch/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to apply filters
    function applyFilters() {
        try {
            // Example filters
            const locationFilter = 'LH_ItemCondition=1000'; // New items
            const shippingFilter = 'LH_ShippedFree=1'; // Free shipping
            const location = 'LH_LocatedIn=1'; // Items located in your country
            const sortFilter = '_sop=15'; // Sort by lowest price + shipping

            // Get the current URL
            let url = new URL(window.location.href);

            // Add filters to the URL if they aren't already present
            if (!url.searchParams.has('LH_ItemCondition')) {
                url.searchParams.append('LH_ItemCondition', '1000');
            }
            if (!url.searchParams.has('LH_ShippedFree')) {
                url.searchParams.append('LH_ShippedFree', '1');
            }
            if (!url.searchParams.has('LH_LocatedIn')) {
                url.searchParams.append('LH_LocatedIn', '1');
            }
            if (!url.searchParams.has('_sop')) {
                url.searchParams.append('_sop', '15');
            }

            // Only navigate if filters were added to avoid infinite reloads
            if (url.toString() !== window.location.href) {
                window.location.href = url.toString();
            }
        } catch (error) {
            console.error('Error applying filters:', error);
        }
    }

    // Apply filters when the page loads
    window.addEventListener('load', applyFilters);
})();

How It Works

  1. The script runs on eBay search pages (https://www.ebay.com/sch/*).
  2. It constructs a new URL with the specified filters if they are not already present.
  3. If the URL changes (i.e., new filters are added), the page navigates to the updated URL.
  4. The script ensures no infinite reloads by checking for existing filters and only navigating when necessary.

Notes

  • The _sop=15 parameter sorts by “Price + Shipping: lowest first” on eBay.
  • The script uses the URL API to manipulate query parameters safely.
  • Tested as of May 14, 2025, on eBay search pages.

Update

eBay uses very aggressive bot detection, and this results in the constant reset of the parameters to set “Lowest Price + P&P first” as the search mode. Ask yourself why that would be?

Because of this – the selection is overridden, the Country code is non-scripted, so it works, all other attempts at any kind of default setting that ISN’T “Best Match” is detected and stopped at site level, they really really want you to see “Best Match”. If you know anything about how the “Best Match” is achieved – you’ll know why.

Further Update

If you do use the method above your account WILL be locked. eBay are an aggressive corporatist company, and my opinion is they are on their way out.

I will be choosing alternative sites to purchase from, as this level of aggressive behaviour is intolerable – coupled with a serious downturn in quality of service and in the site generally.