This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Remove post-sitemap.xml from Yoast Sitemap index without affecting indexability | |
add_filter('wpseo_sitemap_index_links', function ($sitemaps) { | |
foreach ($sitemaps as $key => $sitemap) { | |
if (isset($sitemap['loc']) && strpos($sitemap['loc'], 'post-sitemap.xml') !== false) { | |
unset($sitemaps[$key]); | |
} | |
} | |
return $sitemaps; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Powershell | |
Get-ChildItem -Path . -Recurse -Filter *.txt | Select-String -Pattern "whatever/.com" | ForEach-Object { "$($_.Path): Line $($_.LineNumber): $($_.Line)`n" } | | |
Out-File -FilePath results.txt | |
Get-ChildItem -Path . -Recurse -Filter *.txt | Select-String -Pattern "\@whatever\.com" | ForEach-Object { "$($_.Path): Line $($_.LineNumber): $($_.Line)`n" } | Out-File -FilePath "results_$(Get-Date -Format 'yyyy-MM-dd_HH-mm-ss').txt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const invalidDomains = ["@aol.com","@att.net","@comcast.net","@facebook.com","@gmail.com","@gmx.com","@googlemail.com","@hotmail.com","@hotmail.co.uk","@mac.com","@me.com","@mail.com","@msn.com","@live.com","@sbcglobal.net","@verizon.net","@yahoo.com","@yahoo.co.uk","@email.com","@fastmail.fm","@games.com","@gmx.net","@hush.com","@hushmail.com","@icloud.com","@iname.com","@inbox.com","@lavabit.com","@love.com","@outlook.com","@pobox.com","@protonmail.ch","@protonmail.com","@tutanota.de","@tutanota.com","@tutamail.com","@tuta.io","@keemail.me","@rocketmail.com","@safe-mail.net","@wow.com","@ygm.com","@ymail.com","@zoho.com","@yandex.com","@bellsouth.net","@charter.net","@cox.net","@earthlink.net","@juno.com","@btinternet.com","@virginmedia.com","@blueyonder.co.uk","@freeserve.co.uk","@live.co.uk","@ntlworld.com","@o2.co.uk","@orange.net","@sky.com","@talktalk.co.uk","@tiscali.co.uk","@virgin.net","@wanadoo.co.uk","@bt.com","@sina.com","@sina.cn","@qq.com","@naver.com","@hanmail.net","@daum.net","@nate.com","@y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function () { | |
const invalidDomains = ["@aol.com","@att.net","@comcast.net","@facebook.com","@gmail.com","@gmx.com","@googlemail.com","@hotmail.com","@hotmail.co.uk","@mac.com","@me.com","@mail.com","@msn.com","@live.com","@sbcglobal.net","@verizon.net","@yahoo.com","@yahoo.co.uk","@email.com","@fastmail.fm","@games.com","@gmx.net","@hush.com","@hushmail.com","@icloud.com","@iname.com","@inbox.com","@lavabit.com","@love.com","@outlook.com","@pobox.com","@protonmail.ch","@protonmail.com","@tutanota.de","@tutanota.com","@tutamail.com","@tuta.io","@keemail.me","@rocketmail.com","@safe-mail.net","@wow.com","@ygm.com","@ymail.com","@zoho.com","@yandex.com","@bellsouth.net","@charter.net","@cox.net","@earthlink.net","@juno.com","@btinternet.com","@virginmedia.com","@blueyonder.co.uk","@freeserve.co.uk","@live.co.uk","@ntlworld.com","@o2.co.uk","@orange.net","@sky.com","@talktalk.co.uk","@tiscali.co.uk","@virgin.net","@wanadoo.co.uk","@bt.com","@sina.com","@sina.cn","@qq.com","@naver.com","@hanmail.n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# List of files to copy | |
files=( | |
"/path/to/source/folder1/file1.txt" | |
"/path/to/source/folder2/file2.txt" | |
"/path/to/source/folder3/file3.txt" | |
) | |
# Source and destination directories |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while IFS=, read orig new; do wp --dry-run --skip-themes --skip-plugins search-replace "$orig" "$new" wp_posts --include-columns=post_content --verbose; done < example.csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub DeleteRowsIfContainsSubstring() | |
Dim ws As Worksheet | |
Dim cell As Range | |
Dim deleteSubstring As String | |
Dim lastRow As Long | |
Dim i As Long | |
' Define the substring that will trigger row deletion | |
deleteSubstring = "/page/" ' Change this to your specific substring | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dns.resolver | |
import sys | |
def get_dns_info(domain): | |
try: | |
result = {} | |
for record_type in ['A', 'AAAA', 'MX', 'NS', 'TXT', 'CNAME']: | |
try: | |
answers = dns.resolver.resolve(domain, record_type) | |
result[record_type] = [str(rdata) for rdata in answers] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dns.resolver | |
def get_mx_records(domain): | |
"""Get MX records for a given domain.""" | |
try: | |
answers = dns.resolver.resolve(domain, 'MX') | |
mx_records = [(r.exchange.to_text(), r.preference) for r in answers] | |
return mx_records | |
except (dns.resolver.NoAnswer, dns.resolver.NXDOMAIN, dns.resolver.Timeout) as e: | |
return f"Error retrieving MX records for {domain}: {str(e)}" |
NewerOlder