wp_get_archives
creates its links with the function get_archives_link
. this function returns plain HTML, but it has a filter you can hook into.
You can use the get_archives_link
filter to manipulate your HTML with some regex.
function my_archives_link($link_html) {
//TODO: my regex to manipulate the HTML
return $link_html;
}
add_filter('get_archives_link','my_archives_link')
Further reading
- wp_get_archives
- get_archives_link
- Filter Hook: get_archives_link
Related Posts:
- Prevent 404 when using pre_get_posts to filter an archive page
- Multiple filters for wp_get_archive
- Sorting a specific taxonomy by archive date using URL
- Archive Widget – Count only parent posts
- Filter WordPress Archive Widget to exclude posts with specific custom taxonomy term id
- URL to filter posts by post meta similar to shop/?product_cat=”painting”
- Hide a specific post from Archive Feed
- How to filter users on admin users page by custom meta field?
- Modify WordPress Rest Api Request/Response
- How to add some custom HTML into wordpress admin bar?
- What params are available with the_content filter?
- How to hook wp_list_pages?
- Hook into admin post list page
- Add post/page ID to inserted links within the_content
- How to exclude/filter a tag from get_the_tag_list()
- Ajax, filters and shortcodes
- Filter the blog’s title without using global variables
- Multiple Ajax Data Action
- user_has_cap filter allows edit but will not allow save
- Hook different functions to the same filter conditionally OR Pass additional arguments to existing filter?
- Changing a WordPress core function without hacking core
- Change WordPress RSS link with filter?
- How to remove get_post_metadata using remove_filter inside a class?
- where to apply “apply filters” and other Sanitization Functions
- Add guid filter to attachment in media library grid mode
- Pass parameter to the upload_dir filter
- Sorting and limitation with pre_get_posts
- Warning: Missing argument 2 for widget_title filter
- Change term name only on front
- How do I hide the current page’s title?
- Change name of existing post status type
- add_filter(‘the_content’, ‘…’) stops pagination from working
- How can I exclude tags from category_rss function?
- Header image automatically changes depending on season
- How to remove SKU’s from ALL products in Quick View – already remove from each product page
- How do I use remove_action on an add_action that uses an array?
- What is the downside of using a filter as a “poor man’s” dependency injection?
- Change the default 10-day expiration for the password protected pages cookie
- Add content as soon starts
- How can I change the language of automated Mails?
- How can I replace an oEmbed URL in post with actual embed HTML
- Replacing a deprecated filter ‘woocommerce_get_price’ with ‘woocommerce_product_get_price’
- How do you get specific tags from the_content?
- Add a filter inside an action init
- Is it possible to apply_filter on a wp_ajax_ action?
- Apply filters with multiple filters
- Filter by category and city for doctors and hospitals in wordpress
- Using add_filter to prepend content, result is out of order
- Filtering posts by archive showing all years
- How to display the_archive_title() and the_archive_description() – “weird” interaction
- Why is overwriting $GLOBALS killing the_content()?
- Sorting products by price ( regular + sale price )
- get_posts() interrupt because of filter
- Create new custom field that calculates age
- Remove comments validation (remove filter?)
- How to query if meta_key does exist or not?
- Disable sanitize_file_name on upload without modifying functions.php
- Remove Site Name from wp_title WITHOUT removing from attribute
- Plugin default settings hook
- add_filter to the_content after apply_filters
- Is there any reason for the nested filters to be applied on the first case and not in the second one?
- Best practice: Custom Post Type / Filter / Load more
- How to Edit Ecommerce filters URL, h1, h2 , Title
- Filter Media by attached page or blog post in Library
- How to stop DOMDocument destroying embeds?
- Redirect an archive page to its relevant URL-friendly filtered page
- How to modify image caption in posts?
- Extend Nonce Lifetime for Specific Nonce Creation
- how to use substr with get_the_content()
- AJAX Post Filter
- Mystery line break
- Consult array data in REST API Filter
- How to add markup to the wp-custom-header div
- Display post after choice two taxonomy terms
- How to stop echoing gallery inside content?
- Having issue with dynamic data within restrict_manage_posts function
- how to filter datalist table of wordpress
- Ajax Filtering Pagination
- Custom permalink for attachment
- Overriding Generated Attachment Post URL
- Pagination while keeping the filters
- Is there a function to edit Blogs contents in Blogs page?
- Filter on the day of the week from timestamp
- using filters on the function from class
- Put data in my-account/view-order/id/ page
- Can’t set properly WordPress add_filter function
- Hook inside a hook
- How to check which submission button was clicked?
- check, if any “add_action” function contains string XXXXXXXXX
- filter wptexturize doesn’t work on old posts titles
- remove_action conditionally for Custom Post Type – not working
- wp_get_attachment_link filter not working
- How would I remove an inline googleAPI font script in the the parent theme header.php?
- Getting entry ID from frm_email_message filter in formidable
- Is there a hook or filter that adds a button to the left of the search box?
- Filter and manipulate the get_current_user() function
- add_filter(‘the_content’, ‘method’) does not trigger my custom method
- Better way to change the default password reset url with the woocommerce one?
- woocommerce_coupon_is_valid_for_product not working to exclude specific product tag
- How can I conditionally add the filter option_home?